Пример #1
0
function print_tree($map, $selected, $shift = 0)
{
    if (!empty($map)) {
        foreach ($map as $section) {
            $parent_v = $section['menu_id'] . ':' . $section['mlid'];
            ?>
				<option value="<?php 
            echo $parent_v;
            ?>
"
				<?php 
            if ($parent_v == $selected) {
                echo 'selected';
            }
            ?>
>
				<?php 
            for ($i = 0; $i < $shift; $i++) {
                echo '&nbsp;';
            }
            ?>
				<?php 
            echo $section['link_title'];
            ?>
				</option>
				<?php 
            print_tree($section['children'], $selected, $shift + 5);
        }
    }
}
Пример #2
0
function print_tree($map, $obj, $shift = 0)
{
    if (!empty($map)) {
        foreach ($map as $section) {
            if ($section['mlid'] == $obj['mlid']) {
                continue;
            }
            $parent_v = $section['menu_id'] . ':' . $section['mlid'];
            ?>
				<option value="<?php 
            echo $parent_v;
            ?>
"
				<?php 
            if ($parent_v == $obj['parent']) {
                echo 'selected';
            }
            ?>
 >
				<?php 
            echo str_repeat("&nbsp;", $shift);
            ?>
				<?php 
            echo $section['link_title'];
            ?>
				</option>
				<?php 
            print_tree($section['children'], $obj, $shift + 5);
        }
    }
}
Пример #3
0
function print_tree($node, $indent)
{
    echo str_repeat('...', $indent) . $node['page_id'], "<br>\n";
    if (isset($node['_children'])) {
        foreach ($node['_children'] as $child) {
            print_tree($child, $indent + 1);
        }
    }
}
Пример #4
0
function print_tree($pages, $id_page, $shift = 0)
{
    if (!empty($pages)) {
        foreach ($pages as $page):?>
            <option value="<?= $page['id_page'] ?>" data-url="<?= $page['full_url'] ?>"
                <?php if ($page['id_page'] == $id_page) echo 'selected' ?>>
                <? for ($i = 0; $i < $shift; $i++) echo '&nbsp;';?>
                <?= $page['title'] ?></option>
            <? print_tree($page['children'], $id_page, $shift + 5);?>
        <?php endforeach;
    }
}
Пример #5
0
 function print_tree($tree, $level = 0)
 {
     foreach ($tree as $name => $node) {
         if (is_scalar($node) or is_object($node) and method_exists($node, '__toString')) {
             echo str_repeat('-', $level) . $name . ': ' . $node . "<br>";
         } else {
             if (is_array($node) or is_object($node) and $node instanceof Traversable) {
                 echo str_repeat('-', $level) . $name . "<br>";
                 print_tree($node, $level + 1);
             }
         }
     }
 }
Пример #6
0
function print_tree($data)
{
    $str = "";
    foreach ($data as $list) {
        $str .= "<li><input type='checkbox' value='" . $list['nama'] . "'>" . "<span>" . $list['nama'] . "</span>";
        $subchild = print_tree($list['child']);
        if ($subchild != '') {
            $str .= "<ul>" . $subchild . "</ul>";
        }
        $str .= "</li>";
    }
    return $str;
}
Пример #7
0
 public function getDataFromMatches($myId32, $data, $top_players, $l_m_id = 0, $j = 0)
 {
     $this->load->library("Curl");
     $url = "https://api.steampowered.com/IDOTA2Match_570/GetMatchHistory/V001/?start_at_match_id=" . $l_m_id . "&key=21E317263AE5BBF6B4246783D0246848&account_id=" . $myId32;
     $json = $this->loadPageFromURL($url);
     $page = json_decode($json, true);
     $m_id = array();
     //$last_match_id = $page['result']['matches'][99]['match_id'];
     // Заходим в ветку матчей
     foreach ($page['result']['matches'] as $matches) {
         // Ищем последний матч
         foreach ($matches as $i => $match_id) {
             if ($i == "match_id") {
                 $last_match_id = $match_id;
             }
         }
         foreach ($matches["players"] as $players) {
             foreach ($players as $i => $account_id) {
                 if ($i == "account_id" && $account_id != $myId32 && $account_id != 4294967295) {
                     $mas[$j]['p_id'] = $account_id;
                     $mas[$j]['m_id'] = $matches["match_id"];
                 }
             }
         }
         $j++;
         /*
         // Записываем ID игроков
         			foreach ($matches["players"] as $players) 
         			{
         				foreach ($players as $i => $account_id) 
         				{ 
         					if($i == "account_id" && $account_id != $myId32 && $account_id != 4294967295)
         					{
         						$arr[] = $account_id;
         					}
         				}
         			}		
         */
     }
     echo $last_match_id;
     print_tree($mas);
     /*
     // Заносим элементы в конечный массив
     		$data[] = $arr;
     // Выходим из рекурсии, если
     		if($l_m_id != $last_match_id)
     			return $this->getDataFromMatches($myId32, $top_players, $data, $last_match_id);
     		else
     			return $data;	
     */
 }
Пример #8
0
function print_tree($pages, $shift = 0)
{
    if (!empty($pages)) {
        foreach ($pages as $page) {
            echo '<li class="list-group-item">';
            for ($i = 0; $i < $shift; $i++) {
                echo '&nbsp;';
            }
            echo '<a href="/' . ADMIN_URL . '/page/edit/' . $page['id_page'] . '">' . $page['title'] . ' ' . $page['full_url'] . '</a>
                 <a class="badge btn btn-danger" href="/' . ADMIN_URL . '/page/delete/' . $page['id_page'] . '"> Удалить </a>';
            echo '</li>';
            print_tree($page['children'], $shift + 5);
        }
    }
}
Пример #9
0
function print_tree($node, $indent)
{
    //echo str_repeat('...', $indent) . $node['page_id'], "<br>\n";
    if ($node['page_parentId'] == null || !isset($node['page_parentId'])) {
        echo '<li id="' . $node['page_id'] . '" noDrag="true" noSiblings="true" noDelete="true" noRename="true"><a class="editPage" href="#" title="' . $node['page_title'] . '">' . $node['page_title'] . '</a><a href="#" title="Add child" class="addChild"><img src="include/images/add.png" class="eyelet"/></a><a href="#" title="Edit" class="editContent"><img src="include/images/edit.png" class="eyelet"/></a><a href="#" class="smallText" style="float:right;margin-right:10%;">' . $node['page_status'] . '</a><hr/>';
    } else {
        echo '<li id="' . $node['page_id'] . '" noRename="true" noDelete="true" noDrag="true"><a class="editPage" href="#" title="' . $node['page_title'] . '">' . $node['page_title'] . '</a><a href="#" title="Add child" class="addChild"><img src="include/images/add.png" class="eyelet"/></a><a href="#" title="Delete" class="deletePage"><img src="include/images/delete.png" class="eyelet"/></a><a href="#" title="Edit" class="editContent"><img src="include/images/edit.png" class="eyelet"/></a><a href="#" class="smallText" style="float:right;margin-right:10%;">' . $node['page_status'] . '</a><hr/>';
    }
    if (isset($node['_children'])) {
        echo "<ul>";
        foreach ($node['_children'] as $child) {
            print_tree($child, $indent + 1);
        }
        echo "</ul>";
    }
    echo "</li>";
}
Пример #10
0
function print_tree($node, $indent)
{
    global $j, $k, $l, $all_rows;
    $key = $node['uid'];
    if (strcmp($key, "") != 0) {
        if (strcmp($all_rows[intval($key)]['type'], "group") == 0) {
            echo "<div class='hover' id='groupobj" . $j . "'>" . str_repeat('&nbsp&nbsp&nbsp', $indent) . "<a href='addGroup.php?parent=" . $key . "&source=edit'>" . $all_rows[$key]['name'] . "</a>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</div>";
            echo "<input type='hidden' id='groupid" . $j . "' value=" . $key . ">";
            echo "<input type='hidden' id='groupcoord" . $j++ . "' value=" . $all_rows[$key]['coords'] . ">";
        } else {
            if (strcmp($all_rows[$key]['type'], "fp") == 0) {
                echo "<div class='hover' id='fpobj" . $k . "'>" . str_repeat('&nbsp&nbsp&nbsp', $indent) . "<a href='addFloorPlan.php?parent=" . $key . "&source=edit'>" . $all_rows[$key]['name'] . "</a>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</div>";
                echo "<input type='hidden' id='fpid" . $k . "' value=" . $key . ">";
                echo "<input type='hidden' id='fpname" . $k . "' value=" . str_replace(" ", "+", $all_rows[$key]['name']) . ">";
                echo "<input type='hidden' id='fppath" . $k . "' value=" . $all_rows[$key]['file_path'] . ">";
                echo "<input type='hidden' id='fpcoords" . $k++ . "' value=" . $all_rows[$key]['coords'] . ">";
            } else {
                echo "<div class='hover' id='polyobj" . $l . "'>" . str_repeat('&nbsp&nbsp&nbsp', $indent) . "<a href='mapPolygon.php?parent=" . $key . "&source=edit' >" . $all_rows[$key]['name'] . "</a>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</div>";
                echo "<input type='hidden' id='polyid" . $l . "' value=" . $key . ">";
                echo "<input type='hidden' id='polyname" . $l . "' value=" . str_replace(" ", "+", $all_rows[$key]['name']) . ">";
                echo "<input type='hidden' id='polyradius" . $l . "' value=" . $all_rows[$key]['radius'] . ">";
                echo "<input type='hidden' id='polycoords" . $l++ . "' value=" . $all_rows[$key]['coords'] . ">";
            }
        }
    }
    if (isset($node['_children'])) {
        foreach ($node['_children'] as $child) {
            print_tree($child, $indent + 1);
        }
    }
}
function print_tree($dir = '.')
{
    global $root_path;
    echo '<ul class="dirlist">';
    $d = opendir($dir);
    while ($f = readdir($d)) {
        if (strpos($f, '.') === 0) {
            continue;
        }
        $ff = $dir . '/' . $f;
        if (is_dir($ff)) {
            echo '<li><a href="' . $root_path . '/' . $ff . '/" onclick="load(\'mfm.php?viewdir=' . $ff . '\',\'view-files\'); return false;">' . $f . '</a>';
            print_tree($ff);
            echo '</li>';
        }
    }
    echo '</ul>';
}
Пример #12
0
echo form_open('akses_user/aksesuser');
?>
		
			<ul class="nav nav-tabs">
		        <li class="active"><a data-toggle="tab" href="#tab1">Setup Wewenang</a></li>
		        <li class=""><a data-toggle="tab" href="#tab2">Input User</a></li>
			</ul>
			<div class="tab-content">
				<div class="tab-pane active" id ="tab1">
					<div class="row-fluid">
						<div style="float:left; width:300px;">
							<div class="legend" >Menu</div>
							<div  id="tree_menu" style="border-color:#FFFFFF;">
								<ul class="easyui-tree" data-options="checkbox:true">
									<?php 
echo print_tree($tree);
?>
								</ul>
							</div> <!-- end tree menu -->
							<br />
							<a href="#" class="easyui-linkbutton" onclick="getChecked()">GetChecked</a> 
						</div>
						
						<div style="margin-right: 250px; width:500px;float: right;" class="form-horizontal">
							<div class="legend">Pilih User Level</div>
							<fieldset >
								<table >
									<tr>
										<td>
											<label class="control-label" for="input01">
												Level Id
Пример #13
0
/**
* Prints explorer style tree
*
* @param int $aCategory category id
* @param str $tree
* @param int $aExclude invisible category
* @param bool $aTitle if true logs category titles
*/
function print_tree($aCategory, &$tree, $aExclude = -1, $aTitle = false)
{
    global $gXpAdmin;
    global $gXpConfig;
    $style = (int) $aCategory >= 0 ? ' style="display: none;"' : ' style="display: block;"';
    $tree .= "<ul class=\"tree\"><div id=\"d_{$aCategory}\" {$style}>";
    $categories = $gXpAdmin->getCategoriesByParent($aCategory, TRUE);
    foreach ($categories as $key => $category) {
        $subcategories = $gXpAdmin->getCategoriesByParent($category['id'], TRUE);
        if ($aExclude != $category['id']) {
            if ($subcategories) {
                $tree .= "<li> <a href=\"javascript:divShow('{$category['id']}')\" class=\"no\"><img src=\"img/plus.png\" id=\"im_{$category['id']}\" />&nbsp;</a> ";
                $tree .= "<a href=\"javascript:void(0);\" onClick=\"return_results('{$category['id']}', '{$_GET['items']}', '" . addslashes($category['title']) . "');\">{$category['title']}</a></li>";
            } else {
                $tree .= "<li> <a href=\"javascript:void(0);\" onClick=\"return_results('{$category['id']}', '{$_GET['items']}', '" . addslashes($category['title']) . "');\">{$category['title']}</a></li>";
            }
            if ($subcategories) {
                print_tree($category['id'], $tree);
            }
        }
    }
    $tree .= "</div></ul>";
}
Пример #14
0
function print_tree($map, $shift = 0)
{
    ?>
	<?php 
    if (!empty($map)) {
        ?>
		<?php 
        foreach ($map as $item) {
            ?>
			<tr>				
				<td>
					<?php 
            for ($i = 0; $i < $shift; $i++) {
                echo '&nbsp;';
            }
            ?>
					<a href="<?php 
            echo $item['link_path'];
            ?>
"><?php 
            echo $item['link_title'];
            ?>
</a>
				</td>
				<td>
					<select name="weight_<?php 
            echo $item['mlid'];
            ?>
" class="form-control">
						<?php 
            for ($i = -50; $i <= 50; $i++) {
                ?>
							<?php 
                $is_selected = "";
                if ($i == $item['weight']) {
                    $is_selected = 'selected';
                } elseif ($i == 0 && $item['weight'] === '') {
                    $is_selected = 'selected';
                }
                ?>
						<option value="<?php 
                echo $i;
                ?>
" <?php 
                echo $is_selected;
                ?>
><?php 
                echo $i;
                ?>
</option>
						<?php 
            }
            ?>
					</select>
				</td>
				<td>
				<?php 
            if (M_Users::Instance()->ActiveCan('C_Menu:action_editlink')) {
                ?>
					<a href="<?php 
                echo M_Link::ToAdminMenu('editlink', $item['mlid']);
                ?>
">Изменить</a>
				<?php 
            }
            ?>
				</td>
				<td>
				<?php 
            if (M_Users::Instance()->ActiveCan('C_Menu:action_deletelink')) {
                ?>
					<a href="<?php 
                echo M_Link::ToAdminMenu('deletelink', $item['menu_id'], $item['mlid']);
                ?>
" >Удалить</a>
				<?php 
            }
            ?>
				</td>
			</tr>
			<?php 
            print_tree($item['children'], $shift + 5);
            ?>
		<?php 
        }
        ?>
	<?php 
    }
}
Пример #15
0
    function print_tree($map, $url, $shift = 0)
    {
        ?>
			<?php 
        if (!empty($map)) {
            ?>
			<ul class="list-unstyled">
				<?php 
            foreach ($map as $item) {
                ?>
					<?php 
                $link = rtrim($item['link_path'], '/');
                ?>
					<?php 
                if (strpos($link, 'http') !== 0) {
                    ?>
 
					<?php 
                    $link = BASE_URL . $link;
                    $target = '_self';
                    ?>
					<?php 
                } else {
                    ?>
					<?php 
                    $target = '_blank';
                    ?>
					<?php 
                }
                ?>
					<li <?php 
                if ($url == $link) {
                    ?>
 class="active"<?php 
                }
                ?>
 >
						<a href="<?php 
                echo $link;
                ?>
" target="<?php 
                echo $target;
                ?>
">
							<?php 
                echo str_repeat('&nbsp;', $shift);
                echo $item['link_title'];
                ?>
						</a>
							<?php 
                print_tree($item['children'], $url, 0);
                ?>
					</li>
				<?php 
            }
            ?>
			</ul>
			<?php 
        }
        ?>
	<?php 
    }
Пример #16
0
function print_tree($dir = '.')
{
	global $root_path;
	//$dir = "../../../../archivos/";
	//$dir = "http:///produccion3.ath.cx/archivos/";
	//echo '<br /><br /><br />'.$dir.'<br />';
  	echo '<ul class="dirlist">';
  		$d = opendir($dir);
  		
  		while($f = readdir($d))
  		{
    			if(strpos($f, '.') === 0) continue;
    			$ff = $dir . '/' . $f;
    			if(is_dir($ff))
    			{
  	  			echo '<li><a href="' . $root_path . '/' . $ff . '/" onclick="load(\'mfm.php?viewdir=' . $ff . '\',\'view-files\'); return false;">' . $f . '</a>';
				print_tree($ff);
  	  			echo '</li>';
			}
  		}
  	echo '</ul>';
}
Пример #17
0
    <title>Галерея изображений</title>
    <link rel="stylesheet" type="text/css" href="gallery.css">
</head>
<body>
<div align="center" id="header"><a href="gallery.php"><img src="images/gallery.gif" alt="Галерея" align="middle"></a>
</div>
<div id="sidebar">
    <div class="text">
<?php

    if (isset($dir) && $dir != "./") {
        $parent = dirname($dir);
        print "<a class='home' href='gallery.php?dir=$parent/'>Назад</a><br>";
        print_tree($dir . "*");
    } else {
        print_tree("./*");
    }
    ?>
    </div>
</div>
<div id="content">
<?php
    if (strnatcasecmp($error, 1) == 0) {
        generate_error($error_messages['not_exist_dir'] . " или " . $error_messages['wrong_perm']);
    } else {
        generate_error($error);
    }
    print_images("./*");
    if (isset($dir)) {
        ?>
        <table cellspacing="5">