Пример #1
0
function logTitle()
{
    global $dbClass;
    $formName = "logselect";
    $selected = 0;
    foreach ($_GET as $k => $v) {
        if (ereg("type", $k)) {
            $selected++;
        }
    }
    $l = $dbClass->query("SELECT * FROM " . PP_LOGTABLE . " GROUP BY type ORDER BY type");
    $boxes = array();
    while ($r = $dbClass->next_record($l)) {
        $boxes[] = cbox("type", $r["type"], $formName, !$selected);
    }
    if (empty($boxes)) {
        return False;
    }
    $boxes[] = cbox("x", "since_yesterday", $formName, !$selected);
    print x("form name={$formName}", join("\n", $boxes));
    return True;
}
Пример #2
0
function var_input($infotype, $name, $value = '')
{
    $id = rand();
    echo "<label for='add_{$id}'>" . $infotype['desc'] . "</label>";
    switch (strtolower($infotype['type'])) {
        case "string":
            echo "<input type='text' class='int' id='add_{$id}' name='{$name}' value='";
            ehe($value);
            echo "' size='30' />&nbsp;";
            echo "<em>" . _("Value expected: string") . "</em>";
            break;
        case "integer":
            echo "<input type='text' class='int' id='add_{$id}' name='{$name}' value='";
            ehe($value);
            echo "' size='10' pattern='[0-9]+'/>&nbsp;";
            echo "<em>" . _("Value expected: integer") . "</em>";
            break;
        case "ip":
            echo "<input type='text' class='int' id='add_{$id}' name='{$name}' value='";
            ehe($value);
            echo "' size='15' pattern='[0-9\\.:]+' />&nbsp;";
            echo "<em>" . _("Value expected: IP address") . "</em>";
            break;
        case "boolean":
            echo "<input type='hidden' name='{$name}' value='0' />";
            // This way, there is allways something send, even if checkbox is unchecked
            echo "<input type='checkbox' id='add_{$id}' name='{$name}' value='1' ";
            cbox((bool) $value);
            echo " />";
            break;
        default:
            echo "WTF ? Dunno what to do with a " . $infotype['type'];
            break;
    }
}
Пример #3
0
	<legend>
    <?php 
    __("Do you want to point this domain to another domain already installed in your account?");
    ?>
	</legend>

   <input type="radio" id="newisslave0" name="newisslave" value="0"<?php 
    cbox($newisslave == 0);
    ?>
/><label for="newisslave0"><?php 
    __("No: This domain will have its own folder.");
    ?>
</label>
<br />
   <input type="radio" id="newisslave1" name="newisslave" value="1"<?php 
    cbox($newisslave == 1);
    ?>
/><label for="newisslave1"><?php 
    __("Yes, redirect this new domain to this one:");
    ?>
 </label> <select name="slavedom" id="slavedom" class="inl">
 <option value=""><?php 
    __("-- Choose a domain --");
    ?>
</option>
<?php 
    $dl = $dom->get_domain_list($cuid);
    $ddl = array();
    foreach ($dl as $d) {
        $ddl[$d] = $d;
    }
Пример #4
0
<td class="p10c" width="3%">Usuń</td>
</tr>
<?php 
            if ($razem) {
                print "<tr><td colspan=\"10\" class=\"p10\">" . navigation($razem, $count, "sel", "", $offset, 0, 30, $action) . "</td></tr>";
            }
            print form("lista", "", "");
            if ($sql) {
                if ($sql->RecordCount() > 0) {
                    $lp = $offset;
                    while ($new = $sql->FetchRow()) {
                        if ($new["c_id_s"] > 0) {
                            print "<tr class=\"" . ($new["c_id_s"] == $cID ? "highlight" : "") . "\" onMouseOver=\"this.style.backgroundColor='#FFFF99'; this.style.cursor='pointer';\" onMouseOut=\"this.style.backgroundColor='#ffffff';\">";
                            if (checkPerm('cli', 4)) {
                                print "<td class=\"p10\"><center>";
                                print cbox("check[]", array(), array(), "", "", "v=" . $new["c_id_s"]);
                                print "</center></td>";
                            }
                            print "<td class='p10c'>" . ++$lp . "</td>";
                            print "<td class='p10c'>" . ($new["c_type_e"] == 'dw' ? 'Tak' : 'Nie') . "</td>";
                            print "<td class='p10c'>" . stripslashes($new["c_shortname_c"]) . "</td>";
                            print "<td class='p10'>" . stripslashes($new["c_name_c"]) . "</td>";
                            $adres = $new['c_adr_typ_e'] . " " . $new['c_adr_name_c'] . " " . $new['c_adr_num_c'] . "<br> " . $new['c_adr_zip_c'] . " " . $new['c_adr_msc_c'];
                            print "<td class='p10'>" . $adres . "</td>";
                            print "<td class=\"p10c\">" . $new["c_phone_c"] . "</td>";
                            print "<td class=\"p10c\">" . $new["c_nip_c"] . "</td>";
                            if (checkPerm('cli', 2)) {
                                print "<td><center><a href=\"client," . $new['c_type_e'] . "," . $new["c_id_s"] . ",{$offset}\"><img src=\"img/edit.png\" border=0></a></center></td>";
                            } else {
                                print "<td>&nbsp;</td>";
                            }
Пример #5
0
<tr>
  <td>
    <?php 
    __("Manage the Emails Addresses of this domain on the server?");
    ?>
  </td>
  <td> 
     <input type="radio" id="yesemail" class="inc" name="email" value="1"<?php 
    cbox($r["mail"]);
    ?>
 />&nbsp;<label for="yesemail"><?php 
    __("Yes");
    ?>
</label>
     </td><td><input type="radio" id="noemail" class="inc" name="email" value="0"<?php 
    cbox(!$r["mail"]);
    ?>
 />&nbsp;<label for="noemail"><?php 
    __("No");
    ?>
</label>
  </td>
</tr>
</table>
<p class="alert alert-warning">    <?php 
    __("Warning: If you set this to 'no', all your email accounts and aliases on this domain will be immediately deleted.");
    ?>
</p>
<input type="submit" class="inb ok" name="submit" value="<?php 
    __("Submit the changes");
    ?>
Пример #6
0
    __("Create tmp directory ?");
    ?>
</th>
            <td><input name="create_tmpdir" type="checkbox" value="1" <?php 
    cbox($d['create_tmpdir']);
    ?>
 /></td>
      </tr>
      </tr>
	    <tr>
            <th><?php 
    __("Create target directory ?");
    ?>
</th>
            <td><input name="create_targetdir" type="checkbox" value="1" <?php 
    cbox($d['create_targetdir']);
    ?>
 /></td>
      </tr>
      <tr class="trbtn">
          <td colspan="2">
             <input type="submit" class="inb" name="submit" value="<?php 
    __("Change this domain type");
    ?>
" />
	           <input type="button" class="inb" name="cancel" value="<?php 
    __("Cancel");
    ?>
" onclick="document.location='adm_domstype.php'"/>
          </td>
        </tr>
Пример #7
0
<?php

session_start();
error_reporting(E_ERROR && ~E_NOTICE);
if ($_GET['case'] && $_GET['waluta']) {
    require "../include/conf.inc.php";
    require "../include/db.inc.php";
    require "../include/fc.inc.php";
    require "../include/const.inc.php";
    $string = cbox('faktura', faktury($_GET['case'], $_GET['waluta'], 0), faktury($_GET['case'], $_GET['waluta'], 1), 'ret=1', '<br>');
    echo $string;
} else {
    echo '';
}
Пример #8
0
        <input type="text" size="40" name="domain" value="<?php 
    echo $domain;
    ?>
" />
      </td>
    </tr>
    <tr>
      <td>
        <label for="detect_redirect"><?php 
    __("Do you want to detect the redirection?");
    ?>
</label>
      </td>
      <td>
        <input name="detect_redirect" type="checkbox" value="1" <?php 
    cbox($detect_redirect);
    ?>
 />
      </td>
    </tr>
    <tr>
      <td colspan="2">

        <p>
          <label for="zone"><?php 
    __("Paste your existing DNS zone here.");
    echo '<br/>';
    __("If you don't know what it is, don't submit this form.");
    ?>
</label>
          <textarea cols=100 rows=20 name="zone"><?php 
Пример #9
0
        }
        ?>
</td></tr>
  <tr>  <th><?php 
        __("Do we allow the password to be like the login?");
        ?>
</th>
						<td>
      <input type="radio" name="allowlogin" id="allowlogin0" value="0" <?php 
        cbox(!$c[$edit]["allowlogin"]);
        ?>
 />&nbsp;<?php 
        __("No");
        ?>
      <input type="radio" name="allowlogin" id="allowlogin1" value="1" <?php 
        cbox($c[$edit]["allowlogin"]);
        ?>
 />&nbsp;<?php 
        __("Yes");
        ?>
</td></tr>
</table>
<p><input type="submit" class="inb ok" name="go" value="<?php 
        __("Apply this password policy");
        ?>
" /> &nbsp; 
<input type="button" class="inb cancel" name="cancel" value="<?php 
        __("Cancel and go back to the policy list");
        ?>
" onclick="document.location='adm_passpolicy.php'" /></p>
</form>
Пример #10
0
<tr>
	<th><label><?php 
    __("Compress the backups? (gzip)");
    ?>
</label></th>
	<td>

        <input type="radio" class="inc" id="bck_gzip0" name="bck_gzip" value="0"<?php 
    cbox($r["gzip"] == 0);
    ?>
/><label for="bck_gzip0"><?php 
    __("No");
    ?>
</label><br />
	<input type="radio" class="inc" id="bck_gzip1" name="bck_gzip" value="1"<?php 
    cbox($r["gzip"] == 1);
    ?>
/><label for="bck_gzip1"><?php 
    __("Yes");
    ?>
</label><br />

</td>
</tr>
<tr>
	<th><label for="bck_dir"><?php 
    __("In which folder do you want to store the backups?");
    ?>
</label></th>
	<td><input type="text" class="int" name="bck_dir" id="bck_dir" size="30" maxlength="255" value="<?php 
    @ehe($r["dir"]);
Пример #11
0
    ?>
  <?php 
    print hidden("pi_debtor_id_k", $X['ca_debtor_id_k']);
    ?>
  <tr><td width='60%'>&nbsp;Data wpłaty *<i>(format dd.mm.yyyy)</i></td><td><?php 
    print input('pi_date_d', '', 'w=85', '', "onBlur='javascript: ValidateDate(this);'") . '<img id="pi_date_d_handle" src="./js/calendar/img.gif" border="0" alt="Kalendarz" style="vertical-align: middle; cursor: pointer;"> ';
    ?>
</td></tr>
  <tr><td>&nbsp;Kwota *</td><td><?php 
    print input('pi_amount_f', 0, 'w=100 m=12 cl=p13r', '', 'onKeyUp="comma(this)"');
    ?>
</td></tr>
  <tr><td>&nbsp;Waluta</td><td><?php 
    print select('pi_currency_e', $_currencies, $currencies, 'PLN');
    ?>
</td></tr>
  <tr><td>&nbsp;Zobowiązania</td><td><div id="faktury_wplaty"><?php 
    print cbox('faktura', faktury($caID, 'PLN', 0), faktury($caID, 'PLN', 1), '', '<br>');
    ?>
</div></td></tr>
  <tr><td colspan=2><center><?php 
    print submit('Dodaj wpłatę', 'add_wplata');
    ?>
 <a id='cancel_case' style="cursor:pointer">Wstecz</a></center></td></tr>
  </table>
  <script type="text/javascript"><?php 
    print print_calendar('pi_date_d', 'pi_date_d_handle');
    ?>
</script>
<?php 
}
Пример #12
0
</p>
<?php 
    }
    ?>
</td>
    <td>
      <p>
	<input type="radio" name="islocal" id="islocal0" class="inc" value="0"<?php 
    cbox($islocal == 0);
    ?>
 onclick="popoff()" /><label for="islocal0"><?php 
    __("No");
    ?>
</label>
	<input type="radio" name="islocal" id="islocal1" class="inc" value="1"<?php 
    cbox($islocal == 1);
    ?>
 onclick="popon();" /><label for="islocal1"><?php 
    __("Yes");
    ?>
</label>
      </p>
      <div id="poptbl">
	<table class="tedit" >
          <tr id='mail_edit_pass' style='display: none;'><td colspan='2'><a href='javascript:mail_edit_pass();'><?php 
    __("Click here to edit the existing password");
    ?>
</a></td></tr>
	  <tr id='mail_edit_pass1'><td><label for="pass"><?php 
    __("Enter a POP/IMAP password");
    ?>
Пример #13
0
echo "<select name='db_server_id' id='db_server_id' >";
foreach ($mysql->list_db_servers() as $ldb) {
    echo "<option value='" . $ldb['id'] . "'>" . $ldb['name'] . "</option>";
}
echo "</select>";
?>
    </td>
</tr>

<?php 
if (variable_get('hosting_tld') || $dom->enum_domains()) {
    ?>
<tr>
    <th colspan="2">
        <input type="checkbox" name="create_dom" value="1" class="inc" id="create_dom" <?php 
    cbox($create_dom == 1);
    ?>
/>
        <label for="create_dom"><?php 
    printf(_("Install the domain"), "");
    ?>
</label>
        <span class="int" id="create_dom_list_pfx">login.</span><select name="create_dom_list" class="int" id="create_dom_list">
            <?php 
    if (variable_get('hosting_tld')) {
        ?>
             <option value="<?php 
        echo variable_get('hosting_tld');
        ?>
" selected="selected"><?php 
        echo variable_get('hosting_tld');
Пример #14
0
</tr>
<tr>
	<th><label><?php 
__("Password change allowed?");
?>
</label></th>
	<td>
        <input type="radio" class="inc" id="canpass0" name="canpass" value="0"<?php 
cbox($r["canpass"] == 0);
?>
/><label for="canpass0"><?php 
__("No");
?>
</label><br />
	<input type="radio" class="inc" id="canpass1" name="canpass" value="1"<?php 
cbox($r["canpass"] == 1);
?>
/><label for="canpass1"><?php 
__("Yes");
?>
</label><br />	
	</td>
</tr>
 <tr>
	<th><label for="notes"><?php 
__("Notes");
?>
</label></th>
	<td><textarea name="notes" id="notes" class="int" cols="32" rows="5"><?php 
ehe($r['notes']);
?>
Пример #15
0
function sub_domains_edit($domain, $sub_domain_id = false)
{
    global $admin, $err, $oldid, $isedit;
    $dom = new m_dom();
    $dom->lock();
    if (!($r = $dom->get_domain_all($domain))) {
        $error = $err->errstr();
    }
    /*
    if (! empty($sub)) {
       if (!$sd=$dom->get_sub_domain_all($domain,$sub,$type,$value)) {
         $error=$err->errstr();
       }
    }
    */
    $sd = $dom->get_sub_domain_all($sub_domain_id);
    $type = $sd['type'];
    $sub = $sd['name'];
    $dom->unlock();
    ?>

<form action="dom_subdoedit.php" method="post" name="main" id="main">
    <table border="0">
        <tr>
            <td>
            <input type="hidden" name="domain" value="<?php 
    ehe($domain);
    ?>
" />
            <input type="hidden" name="sub_domain_id" value="<?php 
    echo $sub_domain_id;
    ?>
" />
            <input type="hidden" name="action" value="add" />
  <?php 
    if ($isedit) {
        __("Edit a subdomain:");
    } else {
        __("Create a subdomain:");
    }
    ?>
</td><td>
<input type="text" class="int" name="sub" style="text-align:right" value="<?php 
    ehe($sub);
    ?>
" size="22" id="sub" /><span class="int" id="newsubname">.<?php 
    echo $domain;
    ?>
</span></td>
        </tr>
    <?php 
    $first_advanced = true;
    $lst_advanced = array();
    foreach ($dom->domains_type_lst() as $dt) {
        // If this type is disabled AND it's not the type in use here, continue
        if ($dt['enable'] == 'NONE' && strtoupper($type) != strtoupper($dt['name'])) {
            continue;
        }
        // If this type is only for ADMIN and i'm not an admin, continue (oldid is to check if we are an admin who take user identity)
        if ($dt['enable'] == 'ADMIN' && (!$admin->enabled and !intval($oldid))) {
            continue;
        }
        if (!$r['dns'] and $dt['need_dns']) {
            continue;
        }
        $targval = strtoupper($type) == strtoupper($dt['name']) ? $sd['dest'] : '';
        if ($dt['advanced']) {
            $lst_advanced[] = $dt['name'];
            if ($first_advanced) {
                $first_advanced = false;
                echo "<tr><td colspan=\"2\" class=\"advdom\"></td></tr>";
                echo "<tr id='domtype_show' onClick=\"domtype_advanced_show();\"><td colspan='2'><a href=\"javascript:domtype_advanced_show();\"><b>+ ";
                __("Show advanced options");
                echo "</b></a></td></tr>";
                echo "<tr id='domtype_hide' onClick=\"domtype_advanced_hide();\" style='display:none'><td colspan='2'><a href=\"javascript:domtype_advanced_hide();\"><b>- ";
                __("Hide advanced options");
                echo "</b></a></td></tr>";
                echo "<tr><td colspan=\"2\" class=\"advdom\"></td></tr>";
            }
        }
        ?>
    <tr id="tr_<?php 
        echo $dt['name'];
        ?>
">
      <td>
        <input type="radio" id="r_<?php 
        echo $dt['name'];
        ?>
" class="inc" name="type" value="<?php 
        echo $dt['name'];
        ?>
" <?php 
        cbox(strtoupper($type) == strtoupper($dt['name']));
        ?>
 OnClick="getElementById('t_<?php 
        echo $dt['name'];
        ?>
').focus();"/>
        <label for="r_<?php 
        echo $dt['name'];
        ?>
"><?php 
        __($dt['description']);
        ?>
</label>
      </td>
      <td>
        <?php 
        switch ($dt['target']) {
            case "DIRECTORY":
                ?>
            <input type="text" class="int" name="t_<?php 
                echo $dt['name'];
                ?>
" id="t_<?php 
                echo $dt['name'];
                ?>
" value="<?php 
                ehe($targval);
                ?>
" size="28" onKeyPress="getElementById('r_<?php 
                echo $dt['name'];
                ?>
').checked=true;" />
            <?php 
                display_browser($targval, "main.t_" . $dt['name']);
                break;
            case "URL":
                ?>
              <input type="text" class="int" name="t_<?php 
                echo $dt['name'];
                ?>
" id="t_<?php 
                echo $dt['name'];
                ?>
" value="<?php 
                ehe(empty($targval) ? 'http://' : $targval);
                ?>
" size="50" onKeyPress="getElementById('r_<?php 
                echo $dt['name'];
                ?>
').checked=true;" />
              <small><?php 
                __("(enter an URL here)");
                ?>
</small><?php 
                break;
            case 'IP':
                ?>
              <input type="text" class="int" name="t_<?php 
                echo $dt['name'];
                ?>
" id="t_<?php 
                echo $dt['name'];
                ?>
"  value="<?php 
                ehe($targval);
                ?>
" size="16" onKeyPress="getElementById('r_<?php 
                echo $dt['name'];
                ?>
').checked=true;" />
            <small><?php 
                __("(enter an IPv4 address, for example 192.168.1.2)");
                ?>
</small><?php 
                break;
            case 'IPV6':
                ?>
            <input type="text" class="int" name="t_<?php 
                echo $dt['name'];
                ?>
" id="t_<?php 
                echo $dt['name'];
                ?>
" value="<?php 
                ehe($targval);
                ?>
" size="32" onKeyPress="getElementById('r_<?php 
                echo $dt['name'];
                ?>
').checked=true;" /> 
            <small><?php 
                __("(enter an IPv6 address, for example 2001:0910::0)");
                ?>
</small><?php 
                break;
            case 'TXT':
                ?>
              <input type="text" class="int" name="t_<?php 
                echo $dt['name'];
                ?>
" id="t_<?php 
                echo $dt['name'];
                ?>
" value="<?php 
                ehe($targval);
                ?>
" size="32" onKeyPress="getElementById('r_<?php 
                echo $dt['name'];
                ?>
').checked=true;" />
            <small><?php 
                __("(enter a TXT content for this domain)");
                ?>
</small><?php 
                break;
            case 'DOMAIN':
                ?>
              <input type="text" class="int" name="t_<?php 
                echo $dt['name'];
                ?>
" id="t_<?php 
                echo $dt['name'];
                ?>
" value="<?php 
                ehe($targval);
                ?>
" size="32" onKeyPress="getElementById('r_<?php 
                echo $dt['name'];
                ?>
').checked=true;" /> 
            <small><?php 
                __("(enter a domain name or subdomain)");
                ?>
</small><?php 
                break;
            case "NONE":
            default:
                break;
        }
        // switch
        ?>
      </td>
    </tr>
    <?php 
    }
    // foreach
    ?>

        <tr class="trbtn">
            <td colspan="2"><input type="submit" class="inb ok" name="add" onclick='return check_type_selected();' value="<?php 
    if ($isedit) {
        __("Edit this subdomain");
    } else {
        __("Add this subdomain");
    }
    ?>
" /></td>
        </tr>
    </table>
</form>

<script type="text/javascript">

function check_type_selected() {
  if ( $('input[name=type]:radio:checked').val() ) {
    // there is a value
    var ll = $('input[name=type]:radio:checked').val();
    var tt = $('#t_'+ll);
    if ( tt.length == 0 ) {
      // this element do not exist, so OK
      return true;
    }
    if ( tt.val() == '' ) {
      alert("<?php 
    __("Missing value for this sub-domain");
    ?>
");
      return false;
    }
  
    return true;
  }
  alert("<?php 
    __("Please select a type for this sub-domain");
    ?>
");
  return false;
}

function domtype_advanced_hide() { 
  <?php 
    foreach ($lst_advanced as $adv) {
        echo "\$(\"#tr_{$adv}\").hide();\n";
    }
    ?>
  $("#domtype_show").show();
  $("#domtype_hide").hide();
}
function domtype_advanced_show() { 
  <?php 
    foreach ($lst_advanced as $adv) {
        echo "\$(\"#tr_{$adv}\").show();\n";
    }
    ?>
  $("#domtype_show").hide();
  $("#domtype_hide").show();
}

<?php 
    if (isset($type) && in_array($type, $lst_advanced)) {
        // if it's an edit of an advanced option, we need to show the advanced options
        ?>
  domtype_advanced_show();
<?php 
    } else {
        ?>
  domtype_advanced_hide();
<?php 
    }
    // if advanced
    ?>

</script>
<?php 
}