virt2/api/code/all_modules.php

35 lines
979 B
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
if ($_SESSION['dostup']!=='a')header( 'Location: /403/' );
/*require_once 'api/mysql.php';
$db1 = new MySQL;
$db1 -> connect( $set['bd_host'], $set['bd_user'], $set['bd_pass'], $set['bd_code'] );*/
$db -> change_db( $set['bd_code'] );//выбираем базу с кодом
/* получаем категорию модуля */
unset($a);
if (ID){
$a['parent']=ID;
//узнаем вышестоящий каталог...
unset($b);
$b['id']=ID;
$db -> get_val('mod_cat', $b, 'parent');
$parent=$db->result;
if ($parent>0)$smarty -> assign( 'parent', $parent );
}else
$a['parent']='0';
$db -> get_massiv ( 'mod_cat', $a, 'txt' );
$smarty -> assign( 'cats', $db->result );
unset($b);
$b['parent']=$a['parent'];
$db -> get_massiv ( 'mod', $b, 'mod', '' );
$smarty -> assign( 'list', $db->result );
//$db -> get_massiv ( 'mod', '', 'mod', '' );
//$smarty -> assign( 'list', $db->result );
$db -> change_db ( $set['bd_name'] );
?>