Файл: user/anketa/character_type.php
Строк: 583
<?php
require_once '../../sys/inc/start.php';
require_once '../../sys/inc/compress.php';
require_once '../../sys/inc/sess.php';
require_once '../../sys/inc/settings.php';
require_once '../../sys/inc/db_connect.php';
require_once '../../sys/inc/ipua.php';
require_once '../../sys/inc/fnc.php';
require_once '../../sys/inc/user.php';
only_reg();
$set['title'] = 'Типаж';
require_once '../../sys/inc/thead.php';
if (isset($_POST['save'])) {
if (isset($_POST['ank_hair']) && preg_match('#^([A-zА-я -]*)$#ui', $_POST['ank_hair'])) {
$user['ank_hair'] = htmlspecialchars(mysql_real_escape_string($_POST['ank_hair']));
mysql_query("UPDATE `user` SET `ank_hair` = '" . mysql_real_escape_string($user['ank_hair']) . "' WHERE `id` = '$user[id]' LIMIT 1");
} else {
$err[] = 'Неверный формат цвет волос';
}
if (isset($_POST['ank_eye']) && preg_match('#^([A-zА-я -]*)$#ui', $_POST['ank_eye'])) {
$user['ank_eye'] = htmlspecialchars(mysql_real_escape_string($_POST['ank_eye']));
mysql_query("UPDATE `user` SET `ank_eye` = '" . mysql_real_escape_string($user['ank_eye']) . "' WHERE `id` = '$user[id]' LIMIT 1");
} else {
$err[] = 'Неверный формат цвет глаз';
}
if (isset($_POST['ank_physique']) && $_POST['ank_physique'] == 0) {
$user['ank_physique'] = 0;
mysql_query("UPDATE `user` SET `ank_physique` = '" . ($user['ank_physique'] = 0) . "' WHERE `id` = '$user[id]'");
}
if (isset($_POST['ank_physique']) && $_POST['ank_physique'] == 1) {
$user['ank_physique'] = 1;
mysql_query("UPDATE `user` SET `ank_physique` = '" . ($user['ank_physique'] = 1) . "' WHERE `id` = '$user[id]'");
}
if (isset($_POST['ank_physique']) && $_POST['ank_physique'] == 2) {
$user['ank_physique'] = 2;
mysql_query("UPDATE `user` SET `ank_physique` = '" . ($user['ank_physique'] = 2) . "' WHERE `id` = '$user[id]'");
}
if (isset($_POST['ank_physique']) && $_POST['ank_physique'] == 3) {
$user['ank_physique'] = 3;
mysql_query("UPDATE `user` SET `ank_physique` = '" . ($user['ank_physique'] = 3) . "' WHERE `id` = '$user[id]'");
}
if (isset($_POST['ank_physique']) && $_POST['ank_physique'] == 4) {
$user['ank_physique'] = 4;
mysql_query("UPDATE `user` SET `ank_physique` = '" . ($user['ank_physique'] = 4) . "' WHERE `id` = '$user[id]'");
}
if (isset($_POST['ank_physique']) && $_POST['ank_physique'] == 5) {
$user['ank_physique'] = 5;
mysql_query("UPDATE `user` SET `ank_physique` = '" . ($user['ank_physique'] = 5) . "' WHERE `id` = '$user[id]'");
}
if (isset($_POST['ank_physique']) && $_POST['ank_physique'] == 6) {
$user['ank_physique'] = 6;
mysql_query("UPDATE `user` SET `ank_physique` = '" . ($user['ank_physique'] = 6) . "' WHERE `id` = '$user[id]'");
}
if (isset($_POST['ank_weight']) && (is_numeric($_POST['ank_weight']) && strlen($_POST['ank_weight']) >= 2 && strlen($_POST['ank_weight']) <= 11 || $_POST['ank_weight'] == NULL)) {
$user['ank_weight'] = $_POST['ank_weight'];
mysql_query("UPDATE `user` SET `ank_weight` = '$user[ank_weight]' WHERE `id` = '$user[id]' LIMIT 1");
} else {
$err[] = 'Неверный формат веса';
}
if (isset($_POST['ank_height']) && (is_numeric($_POST['ank_height']) && strlen($_POST['ank_height']) >= 2 && strlen($_POST['ank_height']) <= 11 || $_POST['ank_height'] == NULL)) {
$user['ank_height'] = $_POST['ank_height'];
mysql_query("UPDATE `user` SET `ank_height` = '$user[ank_height]' WHERE `id` = '$user[id]' LIMIT 1");
} else {
$err[] = 'Неверный формат рост';
}
if (!isset($err)) {
msg('Изменения успешно приняты');
}
}
err();
aut();
echo "<div class = 'tabs'>";
echo "<a href = 'setting.php'>Основное</a>";
echo "<a href = 'character_type.php' class = 'active'>Типаж</a>";
echo "<a href = 'interest.php'>Интересы</a>";
echo "<a href = 'dop.php'>Дополнительно</a>";
echo "<a href = 'connected.php'>Контакты</a>";
echo "</div>";
echo "<form method='post' class='tabcontent' action='?$passgen'>n";
echo "<div class='f8'>Цвет волос:<br/><input type='text' name='ank_hair' value='" . output_text($user['ank_hair'], false) . "' maxlength='32' /><br />";
echo "Цвет глаз:<br/><input type='text' name='ank_eye' value='" . output_text($user['ank_eye'], false) . "' maxlength='32' /><br />";
echo "Рост:<br/>";
echo '<select name="ank_height">
<option selected="' . $user['ank_height'] . '" value="' . $user['ank_height'] . '" >' . $user['ank_height'] . '</option>
<option value="80">80</option>
<option value="81">81</option>
<option value="82">82</option>
<option value="83">83</option>
<option value="84">84</option>
<option value="85">85</option>
<option value="86">86</option>
<option value="87">87</option>
<option value="88">88</option>
<option value="89">89</option>
<option value="90">90</option>
<option value="91">91</option>
<option value="92">92</option>
<option value="93">93</option>
<option value="94">94</option>
<option value="95">95</option>
<option value="96">96</option>
<option value="97">97</option>
<option value="98">98</option>
<option value="99">99</option>
<option value="100">100</option>
<option value="101">101</option>
<option value="102">102</option>
<option value="103">103</option>
<option value="104">104</option>
<option value="105">105</option>
<option value="106">106</option>
<option value="107">107</option>
<option value="108">108</option>
<option value="109">109</option>
<option value="110">110</option>
<option value="111">111</option>
<option value="112">112</option>
<option value="113">113</option>
<option value="114">114</option>
<option value="115">115</option>
<option value="116">116</option>
<option value="117">117</option>
<option value="118">118</option>
<option value="119">119</option>
<option value="120">120</option>
<option value="121">121</option>
<option value="122">122</option>
<option value="123">123</option>
<option value="124">124</option>
<option value="125">125</option>
<option value="126">126</option>
<option value="127">127</option>
<option value="128">128</option>
<option value="129">129</option>
<option value="130">130</option>
<option value="131">131</option>
<option value="132">132</option>
<option value="133">133</option>
<option value="134">134</option>
<option value="135">135</option>
<option value="136">136</option>
<option value="137">137</option>
<option value="138">138</option>
<option value="139">139</option>
<option value="140">140</option>
<option value="141">141</option>
<option value="142">142</option>
<option value="143">143</option>
<option value="144">144</option>
<option value="145">145</option>
<option value="146">146</option>
<option value="147">147</option>
<option value="148">148</option>
<option value="149">149</option>
<option value="150">150</option>
<option value="151">151</option>
<option value="152">152</option>
<option value="153">153</option>
<option value="154">154</option>
<option value="155">155</option>
<option value="156">156</option>
<option value="157">157</option>
<option value="158">158</option>
<option value="159">159</option>
<option value="160">160</option>
<option value="161">161</option>
<option value="162">162</option>
<option value="163">163</option>
<option value="164">164</option>
<option value="165">165</option>
<option value="166">166</option>
<option value="167">167</option>
<option value="168">168</option>
<option value="169">169</option>
<option value="170">170</option>
<option value="171">171</option>
<option value="172">172</option>
<option value="173">173</option>
<option value="174">174</option>
<option value="175">175</option>
<option value="176">176</option>
<option value="177">177</option>
<option value="178">178</option>
<option value="179">179</option>
<option value="180">180</option>
<option value="181">181</option>
<option value="182">182</option>
<option value="183">183</option>
<option value="184">184</option>
<option value="185">185</option>
<option value="186">186</option>
<option value="187">187</option>
<option value="188">188</option>
<option value="189">189</option>
<option value="190">190</option>
<option value="191">191</option>
<option value="192">192</option>
<option value="193">193</option>
<option value="194">194</option>
<option value="195">195</option>
<option value="196">196</option>
<option value="197">197</option>
<option value="198">198</option>
<option value="199">199</option>
<option value="200">200</option>
<option value="201">201</option>
<option value="202">202</option>
<option value="203">203</option>
<option value="204">204</option>
<option value="205">205</option>
<option value="206">206</option>
<option value="207">207</option>
<option value="208">208</option>
<option value="209">209</option>
<option value="210">210</option>
</select><br />';
echo "Вес:<br/>";
echo '<select name="ank_weight">
<option selected="' . $user['ank_weight'] . '" value="' . $user['ank_weight'] . '" >' . $user['ank_weight'] . '</option>
<option value="30">30</option>
<option value="31">31</option>
<option value="32">32</option>
<option value="33">33</option>
<option value="34">34</option>
<option value="35">35</option>
<option value="36">36</option>
<option value="37">37</option>
<option value="38">38</option>
<option value="39">39</option>
<option value="40">40</option>
<option value="41">41</option>
<option value="42">42</option>
<option value="43">43</option>
<option value="44">44</option>
<option value="45">45</option>
<option value="46">46</option>
<option value="47">47</option>
<option value="48">48</option>
<option value="49">49</option>
<option value="50">50</option>
<option value="51">51</option>
<option value="52">52</option>
<option value="53">53</option>
<option value="54">54</option>
<option value="55">55</option>
<option value="56">56</option>
<option value="57">57</option>
<option value="58">58</option>
<option value="59">59</option>
<option value="60">60</option>
<option value="61">61</option>
<option value="62">62</option>
<option value="63">63</option>
<option value="64">64</option>
<option value="65">65</option>
<option value="66">66</option>
<option value="67">67</option>
<option value="68">68</option>
<option value="69">69</option>
<option value="70">70</option>
<option value="71">71</option>
<option value="72">72</option>
<option value="73">73</option>
<option value="74">74</option>
<option value="75">75</option>
<option value="76">76</option>
<option value="77">77</option>
<option value="78">78</option>
<option value="79">79</option>
<option value="80">80</option>
<option value="81">81</option>
<option value="82">82</option>
<option value="83">83</option>
<option value="84">84</option>
<option value="85">85</option>
<option value="86">86</option>
<option value="87">87</option>
<option value="88">88</option>
<option value="89">89</option>
<option value="90">90</option>
<option value="91">91</option>
<option value="92">92</option>
<option value="93">93</option>
<option value="94">94</option>
<option value="95">95</option>
<option value="96">96</option>
<option value="97">97</option>
<option value="98">98</option>
<option value="99">99</option>
<option value="100">100</option>
</select><br /></div>';
echo "<div class='f8'>";
echo "Телосложение:";
echo "<br /><input name='ank_physique' type='radio' " . ($user['ank_physique'] == 0 ? ' checked="checked"' : null) . " value='0' /> Не скажу!<br />";
echo " <input name='ank_physique' type='radio' " . ($user['ank_physique'] == 1 ? ' checked="checked"' : null) . " value='1' /> Обычное<br />";
echo " <input name='ank_physique' type='radio' " . ($user['ank_physique'] == 2 ? ' checked="checked"' : null) . " value='2' /> Худощавое<br />";
echo " <input name='ank_physique' type='radio' " . ($user['ank_physique'] == 3 ? ' checked="checked"' : null) . " value='3' /> Спортивное<br />";
echo " <input name='ank_physique' type='radio' " . ($user['ank_physique'] == 4 ? ' checked="checked"' : null) . " value='4' /> Мускулистое<br />";
echo " <input name='ank_physique' type='radio' " . ($user['ank_physique'] == 5 ? ' checked="checked"' : null) . " value='5' /> Плотное<br />";
echo " <input name='ank_physique' type='radio' " . ($user['ank_physique'] == 6 ? ' checked="checked"' : null) . " value='6' /> Полное<br />";
echo "</div><div class = 'f8'>";
echo "<button name = 'save' class = 'btn'>";
echo "<img src = '/style/icons/ok.png' /> Сохранить изменения";
echo "</button></div></form><div class='foot'>";
echo "<a href='/user/anketa/?name=" . $user['nick'] . "'>Посмотреть анкету</a>";
echo "</div>n";
require_once '../../sys/inc/tfoot.php';