X-Git-Url: https://git.llucax.com/mecon/intranet.git/blobdiff_plain/1713650def781c16aadfd73bd9d085a1f50138c3..5bd45a75b2d9ea8c47d6a0ca9940bac005db04eb:/sistema/www/servicios.php?ds=inline diff --git a/sistema/www/servicios.php b/sistema/www/servicios.php index bd80c91..8253b1a 100644 --- a/sistema/www/servicios.php +++ b/sistema/www/servicios.php @@ -1,20 +1,53 @@ addTitle('Servicios'); + + $n_serv = 0; + if(isset($_GET['servicios'])) + $n_serv = $_GET['servicios']; + $serv = new AI_Servicio($n_serv); + //$bd = AI_DB::Connect(); + $bd = DB::Connect('mysql://intranet:intranet@bal747f/intranet'); + $serv->cargar($bd); + $serv->cargarHijos($bd, true, AI_SERVICIO_ORDEN_LONG_HIJOS); + $col_par = ''; + $col_impar = ''; + $impar = true; + $otro = false; + foreach($serv->getHijos() as $s) + { + $sh =& new HTML_Servicio($s->servicio); + if($impar) + { + $col_impar .= $sh->toHTML().'
'; + if ($otro) $otro = false; + else + { + $impar = false; + $otro = true; + } + } + else + { + $col_par .= $sh->toHTML().'
'; + if ($otro) $otro = false; + else + { + $impar = true; + $otro = true; + } + } + } + $m->addStyleSheet($sh->getCSS()); + $tabla =& new HTML_Table(array('width' => 760, + 'cellspacing' => 10)); + $tabla->addRow(array($col_impar, $col_par), array('valign'=>'top')); + $m->addBodyContent($tabla); - $db = IntranetDB::connect(); - $dbdata = array( - 'db' => $db, - 'tabla' => 'servicio', - 'id' => 'servicio', - 'nombre' => 'nombre', - 'id_padre' => 'servicio_padre', - 'link' => 'link'); - $arbol = new HTML_ArbolDB($dbdata, '/MECON/images/arbol_noticias.gif'); - - $m->addBodyContent($arbol); $m->display(); ?>