<?php
  ///////////////////////////////////////////////////
  //Журнал изменений
  //2010 (C)
  //Карпухин Павел
  ///////////////////////////////////////////////////

  $lang = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"], 0,2);
  if(is_file ("../lang/".$lang.".php")) include "../lang/".$lang.".php";
     else include "../lang/ru.php";

  $title=$titlepage = $TEXT['zhurn-edit'];
  $helppage = $TEXT['zhurn-edit-help'];

  require_once "../config.php";
  require_once "top.php";
  include "tags_know.js";
  ?>
  <title><?php echo $title; ?></title>
  <link rel="StyleSheet" type="text/css" href="../utils/grid.css" />
  </head>
  <body leftmargin="0" marginheight="0" marginwidth="0" rightmargin="0" bottommargin="0" topmargin="0" >
  <?php
  if($result2['administrator'] == 0) puterror2($TEXT['error-supp11']);

  if(!isset($button)) $button = $TEXT['btn_save'];
  if(!isset($action)) $action = "zhurn_edit.php";

  if(empty($_GET['zh_str_id'])) puterror2($TEXT['error-zhurn1']);
  if(strlen($_GET['zh_str_id'])>11) puterror2($TEXT['error-zhurn2']);
  if(empty($_GET['zhurn_id'])) puterror2($TEXT['error-zhurn11']);
  if(strlen($_GET['zhurn_id'])>11) puterror2($TEXT['error-zhurn12']);
  if(strlen($_GET['k'])>8) puterror2($TEXT['error-zhurn15']);
  $old_zh_str_id = $_GET['zh_str_id'];
  $old_zhurn_id = $_GET['zhurn_id'];
  $old_k = $_GET['k'];

  $query3 = "SELECT * FROM `tbl_zhurnal` WHERE `zhurn_id` = ".$_GET['zhurn_id']."";
   $tmp3 = mysql_query($query3);
    if(!$tmp3) puterror2($TEXT['error-tbl41']);
     $tmp_pos = mysql_fetch_array($tmp3,MYSQL_ASSOC);
?>
<table class="tabledata" align="center">
  <tr><td class="z1"><?php echo $titlepage; ?></td></tr>
  <tr><td class="help"><?php echo $helppage; ?></td></tr>
</table>
<br />
<form enctype='multipart/form-data' name='form' action=<?php echo $action; ?> method=post>
<table class="tabledata" align="center">
<tr><td class="support2"><?php echo $TEXT['izm-tema']; ?>:</td><td class="support"><input size=50 maxlength=255 type=text name=tema value="<?php echo $tmp_pos['zh_tema']; ?>" /></td><td></td></tr>
<tr><td class="support2"><?php echo $TEXT['izm-soobsch']; ?>:</td><td class="support"><textarea cols="50" rows="10" name=zh_soobschenie ><?php echo $tmp_pos['zh_soobschenie']; ?></textarea></td>
<td>
        <a href="javascript:inserttags('<span%20class=&quot;fntbld&quot;>','</span>')" title="<?php echo $TEXT['new-tag1']; ?>"><img alt="картинка" src="../admin/img/bold.png" align=middle /></a>
        <a href="javascript:inserttags('<span%20class=&quot;fntit&quot;>','</span>')" title="<?php echo $TEXT['new-tag2']; ?>"><img alt="картинка" src="../admin/img/italic.png" align=middle /></a>
        <a href="javascript:inserttags('<span%20class=&quot;fntunderline&quot;>','</span>')" title="<?php echo $TEXT['new-tag3']; ?>"><img alt="картинка" src="../admin/img/underline.png" align=middle /></a>
        <a href="javascript:inserttags('<span%20class=&quot;fntzacherknuto&quot;>','</span>')" title="<?php echo $TEXT['new-tag4']; ?>"><img alt="картинка" src="../admin/img/linetrough.png" align=middle /></a>
        <br />
        <a href="javascript:inserttags('<sup>','</sup>')" title="<?php echo $TEXT['new-tag6']; ?>"><img alt="картинка" src="../admin/img/sup.png" align=middle /></a>
        <a href="javascript:inserttags('<sub>','</sub>')" title="<?php echo $TEXT['new-tag5']; ?>"><img alt="картинка" src="../admin/img/sub.png" align=middle /></a>
        <a href="javascript:inserttags('<p>','</p>')" title="<?php echo $TEXT['new-tag7']; ?>"><img alt="картинка" src="../admin/img/paragraf.png" align=middle /></a>
        <a href="javascript:inserttags('<hr />','')" title="<?php echo $TEXT['new-tag8']; ?>"><img alt="картинка" src="../admin/img/hr.png" align=middle /></a>
        <br />
        <a href="javascript:inserttags('<font%20size=&quot;&quot;>','</font>')" title="<?php echo $TEXT['new-tag9']; ?>"><img alt="picture" src="../admin/img/fontsize.png" align=middle /></a>
        <a href="javascript:inserttags('<span%20class=&quot;fntbldzag&quot;>','</span>')" title="<?php echo $TEXT['new-tag16'].$TEXT['new-tag17']; ?>"><img alt="font16" src="../admin/img/fontsize16.png" align=middle /></a>
        <a href="javascript:inserttags('<span%20class=&quot;fntbldzag2&quot;>','</span>')" title="<?php echo $TEXT['new-tag16'].$TEXT['new-tag18']; ?>"><img alt="font18" src="../admin/img/fontsize18.png" align=middle /></a>
        <a href="javascript:inserttags('<span%20class=&quot;zagolovok&quot;>','</span>')" title="<?php echo $TEXT['new-tag16'].$TEXT['new-tag19']; ?>"><img alt="font20" src="../admin/img/fontsize20.png" align=middle /></a>
        <br />
        <a href="javascript:inserttags('<span%20class=&quot;buttonbkg&quot;>','</span>')" title="<?php echo $TEXT['new-tag38']; ?>"><img alt="картинка" src="../admin/img/btn.png" align=middle /></a>
        <a href="javascript:inserttags('<span%20class=&quot;fntred&quot;>','</span>')" title="<?php echo $TEXT['new-tag20'].$TEXT['new-tag21']; ?>"><img alt="text-red" src="../admin/img/textcolor-red.png" align=middle /></a>
        <a href="javascript:inserttags('<span%20class=&quot;fntgreen&quot;>','</span>')" title="<?php echo $TEXT['new-tag20'].$TEXT['new-tag22']; ?>"><img alt="text-green" src="../admin/img/textcolor-green.png" align=middle /></a>
        <a href="javascript:inserttags('<span%20class=&quot;fntblue&quot;>','</span>')" title="<?php echo $TEXT['new-tag20'].$TEXT['new-tag23']; ?>"><img alt="text-blue" src="../admin/img/textcolor-blue.png" align=middle /></a>
        <br />
        <a href="javascript:inserttags('<span%20class=&quot;fntgray&quot;>','</span>')" title="<?php echo $TEXT['new-tag20'].$TEXT['new-tag39']; ?>"><img alt="text-gray" src="../admin/img/textcolor-gray.png" align=middle /></a>
        <a href="javascript:inserttags('<span%20class=&quot;fntorange&quot;>','</span>')" title="<?php echo $TEXT['new-tag20'].$TEXT['new-tag40']; ?>"><img alt="text-orange" src="../admin/img/textcolor-orange.png" align=middle /></a>
        <a href="javascript:inserttags('<span%20class=&quot;fntkorich&quot;>','</span>')" title="<?php echo $TEXT['new-tag20'].$TEXT['new-tag41']; ?>"><img alt="text-brown" src="../admin/img/textcolor-brown.png" align=middle /></a>
        <a href="javascript:inserttags('<span%20class=&quot;fntwhite&quot;>','</span>')" title="<?php echo $TEXT['new-tag20'].$TEXT['new-tag42']; ?>"><img alt="text-white" src="../admin/img/textcolor-white.png" align=middle /></a>
        <br />
        <a href="javascript:inserttags('<span%20id=&quot;marobj&quot;%20class=&quot;fntmarckgreen&quot;>','</span>')" title="<?php echo $TEXT['new-tag31']; ?>"><img alt="marc-green" src="../admin/img/marck-green.png" align=middle border=0 /></a>
        <a href="javascript:inserttags('<span%20id=&quot;marobj&quot;%20class=&quot;fntmarckorange&quot;>','</span>')" title="<?php echo $TEXT['new-tag29']; ?>"><img alt="marc-orange" src="../admin/img/marck-orange.png" align=middle border=0 /></a>
        <a href="javascript:inserttags('<span%20id=&quot;marobj&quot;%20class=&quot;fntmarckyellow&quot;>','</span>')" title="<?php echo $TEXT['new-tag30']; ?>"><img alt="marc-yellow" src="../admin/img/marck-yellow.png" align=middle border=0 /></a>
        <a href="javascript:inserttags('<span%20id=&quot;marobj&quot;%20class=&quot;fntmarckgray&quot;>','</span>')" title="<?php echo $TEXT['new-tag28']; ?>"><img alt="marc-grey" src="../admin/img/marck-grey.png" align=middle border=0 /></a>
        <br />
        <a href="javascript:inserttags('<p%20class=&quot;console&quot;><img%20class=&quot;tipsimg&quot;%20alt=&quot;console&quot;%20src=&quot;../admin/img/cmd.png&quot; />','</p>')" title="<?php echo $TEXT['new-tag24']; ?>"><img alt="console" src="../admin/img/console.png" align=middle /></a>
        <a href="javascript:inserttags('<p%20class=&quot;tips&quot;><img%20class=&quot;tipsimg&quot;%20alt=&quot;tips&quot;%20src=&quot;../admin/img/note.png&quot; />','</p>')" title="<?php echo $TEXT['new-tag26']; ?>"><img alt="tips" src="../admin/img/tips-pic.png" align=middle /></a>
        <a href="javascript:inserttags('<p%20class=&quot;textfilecont&quot;><img%20class=&quot;tipsimg&quot;%20alt=&quot;text&quot;%20src=&quot;../admin/img/text.png&quot; />','</p>')" title="<?php echo $TEXT['new-tag25']; ?>"><img alt="text" src="../admin/img/text-pic.png" align=middle /></a>
        <a href="javascript:inserttags('<span%20class=&quot;tooltip&quot;>место%20для%20слова<span>то%20что%20будет%20всплывать,%20очень%20кратко','<small></small></span></span>')" title="<?php echo $TEXT['new-tag27']; ?>"><img alt="baloon" src="../admin/img/note-pic.png" align=middle /></a>
        <br />
        <a href="javascript:inserttags('&ldquo;','&rdquo;')" title="<?php echo $TEXT['new-tag15']; ?>"><img alt="картинка" src="../admin/img/quote1.png" align=middle /></a>
        <a href="javascript:inserttags('&laquo;','&raquo;')" title="<?php echo $TEXT['new-tag15']; ?>"><img alt="картинка" src="../admin/img/quote2.png" align=middle /></a>
        <a href="javascript:inserttags('&#9632;','')" title="<?php echo $TEXT['new-tag11']; ?>"><img alt="картинка" src="../admin/img/list.png" align=middle /></a>
        <a href="javascript:inserttags('&#9679;','')" title="<?php echo $TEXT['new-tag12']; ?>"><img alt="картинка" src="../admin/img/listelement.png" align=middle /></a>
</td>
</tr>
<tr><td class="support2"><?php echo $TEXT['izm-pos']; ?>:</td><td class="support"><input size=6 maxlength=6 type=text name=position value="<?php echo $tmp_pos['position']; ?>" /></td><td></td></tr>
<tr><td class="support2"><?php echo $TEXT['izm-krit']; ?>:</td>
    <td class="support"><select name="krit_id">
    <?php
        $query4 = "SELECT * FROM `tbl_kritichnost` WHERE `krit_id` != '0' ORDER BY position, kritichnost";
        $kritichnost_tmp = mysql_query($query4);
          if(!$kritichnost_tmp) puterror2($TEXT['error-tbl39']);
              while($kritichnost = mysql_fetch_array($kritichnost_tmp,MYSQL_ASSOC))
                {
                if($kritichnost['krit_id'] == $tmp_pos['krit_id']) $chk = "<option selected value=".$kritichnost['krit_id'].">".$kritichnost['kritichnost']."";
                 else $chk = "<option value=".$kritichnost['krit_id'].">".$kritichnost['kritichnost']."";
                echo $chk;
                }
    ?>
    </select></td><td></td></tr>
<tr><td></td><td>
  <input class="button" type=submit value='<?php echo $button; ?>' />
  <input type=hidden name=zh_str_id value='<?php echo $old_zh_str_id; ?>' />
  <input type=hidden name=zhurn_id value='<?php echo $old_zhurn_id; ?>' />
  <input type=hidden name=k value='<?php echo $old_k; ?>' />
</td>
<td></td>
</tr>
</table>
</form>
</body>
</html>