<?php
  ///////////////////////////////////////////////////
  //2007 (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['support33'];
  require_once "../config.php";
  require_once "top.php";
  ?>
  <meta http-equiv='Refresh' content='300; URL=manager.php' />
  <title><?php echo $title; ?></title>
  <link rel="StyleSheet" type="text/css" href="../utils/reader.css" />
  </head>
  <body>
  <?php
  
  if($result2['user'] == 1) puterror2($TEXT['error-supp11']);
  if($result2['master'] == 1) puterror2($TEXT['error-supp11']);

  if(empty($_GET['arch_id'])) puterror2($TEXT['error-usr1']);
  if(strlen($_GET['arch_id'])>11) puterror2($TEXT['error-usr2']);
  $_GET['arch_id'] = rep($_GET['arch_id']);

       $query_zaya = "SELECT tbl_supp_archive.*, UNIX_TIMESTAMP(data) AS data FROM tbl_supp_archive WHERE arch_id = '".$_GET['arch_id']."'";
       $zaya = mysql_query($query_zaya);
         if(!$zaya) puterror2($TEXT['error-tbl26']);
          $zayavka = mysql_fetch_array($zaya,MYSQL_ASSOC);

          if(!empty($zayavka['pic_tr']) && $zayavka['pic_tr']!=="-" && file_exists("../".$zayavka['pic_tr'])) $file_image = "<a href='../".$zayavka['pic_tr']."' target=_blank title='".$TEXT['support26']."'><img alt='picture' src='../img/filesave.png' /></a>";
           else $file_image = $TEXT['support28'];

          $month["01"] = $TEXT['month01'];
          $month["02"] = $TEXT['month02'];
          $month["03"] = $TEXT['month03'];
          $month["04"] = $TEXT['month04'];
          $month["05"] = $TEXT['month05'];
          $month["06"] = $TEXT['month06'];
          $month["07"] = $TEXT['month07'];
          $month["08"] = $TEXT['month08'];
          $month["09"] = $TEXT['month09'];
          $month["10"] = $TEXT['month10'];
          $month["11"] = $TEXT['month11'];
          $month["12"] = $TEXT['month12'];

          $date_day = date("d",$zayavka['data']);
          $date_month = date("m",$zayavka['data']);
          $date_year = date("Y",$zayavka['data']);
          $year = $TEXT['year'];
          if($zayavka['data'] == "" || $zayavka['data'] == "0") $data_r = "---";
           else $data_r = (date("$date_day $month[$date_month] $date_year $year"));

?>
     <table align='center' border='0' width='60%' cellpadding='0' cellspacing='0'><tr>
      <td>
         <fieldset class='zayavka' >
         <legend align="left"><?php echo $TEXT['support1']; ?> <?php echo $zayavka['zay_id']; ?></legend>
          <table align='center' border='0' width='100%' cellpadding='0' cellspacing='0'>
             <tr>
               <td align="right" width="30%" class="support"><?php echo $TEXT['support30']; ?></td>
               <td width="70%" class="support_ob8" align="left">:&nbsp;<?php echo $zayavka['user']; ?></td>
             </tr>
             <tr>
               <td align="right" width="30%" class="support"><?php echo $TEXT['support13']; ?></td>
               <td width="70%" class="support" align="left">:&nbsp;<?php echo $zayavka['tema']; ?></td>
             </tr>
             <tr>
               <td align="right" width="30%" class="support"><?php echo $TEXT['support14']; ?>&nbsp;</td>
               <td class="support_ob3" width="70%" align="left">&nbsp;<?php echo nl2br($zayavka['problema']); ?></td>
             </tr>
             <tr>
               <td align="right" width="30%" class="support"><?php echo $TEXT['support46']; ?>&nbsp;</td>
               <td class="support_ob7" width="70%" align="left">&nbsp;<?php echo nl2br($zayavka['reshenie']); ?></td>
             </tr>
             <tr>
               <td align="right" width="30%" class="support"><?php echo $TEXT['support26']; ?></td>
               <td class="flop" width="70%" align="left">&nbsp;<?php echo $file_image; ?></td>
             </tr>
             <tr>
               <td align="right" width="30%" class="support"><?php echo $TEXT['support42']; ?></td>
               <td class="support_ob4" width="70%" align="left">:&nbsp;<?php echo $zayavka['manager']; ?></td>
             </tr>
             <tr>
               <td align="right" width="30%" class="support"><?php echo $TEXT['support43']; ?></td>
               <td class="support_ob" width="70%" align="left">:&nbsp;<?php echo $zayavka['master']; ?></td>
             </tr>
             <tr>
               <td align="right" width="30%" class="support"><?php echo $TEXT['support54']; ?></td>
               <td class="support_ob2" width="70%" align="left">:&nbsp;<?php echo $data_r; ?></td>
             </tr>
          </table>
       </fieldset>
     </td>
    </tr>
  </table>
</body>
</html>