<?php
  ///////////////////////////////////////////////////
  //2007 (C)
  //Карпухин Павел
  ///////////////////////////////////////////////////

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

  $title=$titlepage = $TEXT['global-srvset'];
  $helppage = $TEXT['global-srvset-title'];
  require_once "../config.php";
  require_once "../util/top.php";
  if(!isset($button)) $button = $TEXT['btn_edit'];
  if(!isset($action)) $action = "edit.php";

  if($result2['administrator'] == 0) puterror2($TEXT['error-loginform4']);

//  $query_iskh4 = "SELECT * FROM `tbl_srv_param` LIMIT 1";
//  $result_iskh4 = mysql_query($query_iskh4);
//  if(!$result_iskh4) puterror2($TEXT['error-tbl44']);
//   $result_srv_set = mysql_fetch_array($result_iskh4,MYSQL_ASSOC);

 if($result_srv_set['repl'] == 1) $repl_chk = "checked";
  else $repl_chk = "";

 if($result_srv_set['repl_mail'] == "yes") $repl_mail_chk = "checked";
  else $repl_mail_chk = "";
?>
<form enctype='multipart/form-data' action=<?php echo $action; ?> method=post>
<table border="0" width="100%" align="center">
<tr>
<td width="25%">
  <fieldset>
    <legend align="left" title="<?php echo $TEXT['global-srvldap']; ?>"><?php echo $TEXT['global-srvldap2']; ?></legend>
     <table border="0" width="100%" align="center">
      <tr><td class="useraddedit"><?php echo $TEXT['global-srvldap']; ?>:</td><td>
        <select name=ldp>
          <option value='0' <?php if ($result_srv_set['ldp'] == "0") echo "selected"?>><?php echo $TEXT['res-field17']; ?>
          <option value='1' <?php if ($result_srv_set['ldp'] == "1") echo "selected"?>><?php echo $TEXT['res-field16']; ?>
        </select>
      </td></tr>
      <tr><td class="useraddedit"><?php echo $TEXT['global-srvldap3']; ?>:</td><td><input size=20 maxlength=255 type=text name=ldp_dn value='<?php echo $result_srv_set['ldp_dn']; ?>'></td></tr>
      <tr><td class="useraddedit"><?php echo $TEXT['login-user']; ?>:</td><td><input size=20 maxlength=255 type=text name=ldp_user value='<?php echo $result_srv_set['ldp_user']; ?>'></td></tr>
      <tr><td class="useraddedit"><?php echo $TEXT['login-password']; ?>:</td><td><input size=20 maxlength=255 type=text name=ldp_pass value='<?php echo $result_srv_set['ldp_pass']; ?>'></td></tr>
      <tr><td class="useraddedit"><?php echo $TEXT['global-srvldap4']; ?>:</td><td><input size=20 maxlength=255 type=text name=dlp_srv value='<?php echo $result_srv_set['dlp_srv']; ?>'></td></tr>
      <tr><td class="useraddedit"><?php echo $TEXT['global-srvldap5']; ?>:</td><td><input size=5 maxlength=5 type=text name=ldp_port value='<?php echo $result_srv_set['ldp_port']; ?>'></td></tr>
     </table>
  </fieldset>
  <fieldset>
    <legend align="left" title="<?php echo $TEXT['repl-on-tit']; ?>"><?php echo $TEXT['repl-on-tit']; ?></legend>
     <table border="0" width="100%" align="center">
      <tr><td class="useraddedit"><?php echo $TEXT['repl-on']; ?></td><td><input type=checkbox name=repl <?php echo $repl_chk; ?>></td></tr>
      <tr><td class="useraddedit"><?php echo $TEXT['repl-org-koren']; ?></td>
      <td class="useraddedit"><select name="rep_org_id">
      <?php
        $query4 = "SELECT * FROM `tbl_organizaciya` WHERE `visible` != 'hide' ORDER BY position";
        $organizaciya_tmp = mysql_query($query4);
          if(!$organizaciya_tmp) puterror2($TEXT['error-tbl7']);
              while($organizaciya = mysql_fetch_array($organizaciya_tmp,MYSQL_ASSOC))
                {
                 if($organizaciya['org_id'] == $result_srv_set['org_id'])
                   {
                   $chk = "<option selected value=".$organizaciya['org_id'].">".$organizaciya['organizaciya']."";
                   }
                 else $chk = "<option value=".$organizaciya['org_id'].">".$organizaciya['organizaciya']."";
                 echo $chk;
                }
    ?>
    </select></td></tr>
      <tr><td class="useraddedit"><?php echo $TEXT['repl-only-mail']; ?></td><td><input type=checkbox name=repl_mail <?php echo $repl_mail_chk; ?>></td></tr>
     </table>
  </fieldset>
</td>
<td width="25%">
    <fieldset>
    <legend align="left" title="<?php echo $TEXT['exim-help']; ?>"><?php echo $TEXT['exim-title']; ?></legend>
     <table border="0" width="100%" align="center">
      <tr><td class="useraddedit"><?php echo $TEXT['user-shell']; ?></td><td><input size=20 maxlength=255 type=text name=exim_shell value='<?php echo $result_srv_set['exim_shell']; ?>'></td></tr>
      <tr><td class="useraddedit"><?php echo $TEXT['user-uid']; ?></td><td><input size=5 maxlength=5 type=text name=exim_uid value='<?php echo $result_srv_set['exim_uid']; ?>'></td></tr>
      <tr><td class="useraddedit"><?php echo $TEXT['user-gid']; ?></td><td><input size=5 maxlength=5 type=text name=exim_gid value='<?php echo $result_srv_set['exim_gid']; ?>'></td></tr>
      <tr><td class="useraddedit"><?php echo $TEXT['global-srvldap6']; ?>:</td><td><input size=20 maxlength=255 type=text name=exim_home value='<?php echo $result_srv_set['exim_home']; ?>'></td></tr>
      <tr><td class="useraddedit"><?php echo $TEXT['res-field11']; ?>:</td><td><input size=5 maxlength=5 type=text name=exim_kvota value='<?php echo $result_srv_set['exim_kvota']; ?>'></td></tr>
      <tr><td class="useraddedit"><?php echo $TEXT['global-srvldap7']; ?>:</td><td><input size=5 maxlength=5 type=text name=exim_pas value='<?php echo $result_srv_set['exim_pass']; ?>'></td></tr>
     </table>
  </fieldset>
 </td>
 <td width="30%">
    <fieldset>
    <legend align="left" title="<?php echo $TEXT['global-srvldap9']; ?>"><?php echo $TEXT['global-srvldap8']; ?></legend>
     <table border="0" width="100%" align="center">
      <tr><td class="useraddedit"><?php echo $TEXT['global-srvldap10']; ?>:</td><td><input size=20 maxlength=255 type=text name=admin_mail_rss value='<?php echo $result_srv_set['admin_mail_rss']; ?>'></td></tr>
      <tr><td class="useraddedit"><?php echo $TEXT['global-srvldap11']; ?>:</td><td><input size=20 maxlength=255 type=text name=admin_mail_news value='<?php echo $result_srv_set['admin_mail_news']; ?>'></td></tr>
      <tr><td class="useraddedit"><?php echo $TEXT['global-srvldap12']; ?>:</td><td><input size=20 maxlength=255 type=text name=admin_mail value='<?php echo $result_srv_set['admin_mail']; ?>'></td></tr>
      <tr><td class="useraddedit"><?php echo $TEXT['global-srvldap7']; ?>:</td><td><input size=5 maxlength=5 type=text name=spr_pass value='<?php echo $result_srv_set['spr_pass']; ?>'></td></tr>
      <tr><td class="useraddedit"><?php echo $TEXT['global-srvset3']; ?> (W):</td><td><input size=5 maxlength=5 type=text name=glob_w value='<?php echo $result_srv_set['glob_w']; ?>'></td></tr>
      <tr><td class="useraddedit"><?php echo $TEXT['global-srvset3']; ?> (H):</td><td><input size=5 maxlength=5 type=text name=glob_h value='<?php echo $result_srv_set['glob_h']; ?>'></td></tr>
      <tr><td class="useraddedit"><?php echo $TEXT['global-srvset8']; ?>:</td><td><input size=21 maxlength=21 type=text name=prx_set value='<?php echo $result_srv_set['prx_set']; ?>'></td></tr>
     </table>
   </fieldset>
  </td>
 <td width="20%">
    <fieldset>
    <legend align="left" title="<?php echo $TEXT['global-srvset2-title']; ?>"><?php echo $TEXT['global-srvset2']; ?></legend>
     <table border="0" width="100%" align="center">
      <tr><td class="useraddedit"><?php echo $TEXT['global-srvset4']; ?> (W):</td><td><input size=5 maxlength=5 type=text name=user_w value='<?php echo $result_srv_set['user_w']; ?>'></td></tr>
      <tr><td class="useraddedit"><?php echo $TEXT['global-srvset4']; ?> (H):</td><td><input size=5 maxlength=5 type=text name=user_h value='<?php echo $result_srv_set['user_h']; ?>'></td></tr>
      <tr><td class="useraddedit"><?php echo $TEXT['global-srvset5']; ?> (W):</td><td><input size=5 maxlength=5 type=text name=exim_w value='<?php echo $result_srv_set['exim_w']; ?>'></td></tr>
      <tr><td class="useraddedit"><?php echo $TEXT['global-srvset5']; ?> (H):</td><td><input size=5 maxlength=5 type=text name=exim_h value='<?php echo $result_srv_set['exim_h']; ?>'></td></tr>
      <tr><td class="useraddedit"><?php echo $TEXT['global-srvset6']; ?> (W):</td><td><input size=5 maxlength=5 type=text name=res_w value='<?php echo $result_srv_set['res_w']; ?>'></td></tr>
      <tr><td class="useraddedit"><?php echo $TEXT['global-srvset6']; ?> (H):</td><td><input size=5 maxlength=5 type=text name=res_h value='<?php echo $result_srv_set['res_h']; ?>'></td></tr>
     </table>
  </fieldset>
 </td>
 </tr>
 <tr><td align="left">
   <input type=hidden name="srvp_id" value='<?php echo $result_srv_set['srvp_id']; ?>' />
   <input class="button2" type=submit value='<?php echo $button; ?>' />
 </td></tr>
</table>
</form>
<?php
  require_once "../util/bottom.php";
?>