Example #1
0
function view1()
{
    global $cfg, $db;
    authenticate('access_media');
    // TODO: check if genre_id is is genre_id or genre_string
    $artist = get('artist');
    $genre_id = get('genre_id');
    $filter = get('filter');
    if ($genre_id) {
        if (substr($genre_id, -1) == '~') {
            $query = mysql_query('SELECT artist_alphabetic
				FROM album
				WHERE genre_id = "' . mysql_real_escape_string(substr($genre_id, 0, -1)) . '"
				GROUP BY artist_alphabetic
				ORDER BY artist_alphabetic');
        } else {
            $query = mysql_query('SELECT artist_alphabetic
				FROM album
				WHERE genre_id LIKE "' . mysql_real_escape_like($genre_id) . '%"
				GROUP BY artist_alphabetic
				ORDER BY artist_alphabetic');
        }
        if (mysql_num_rows($query) == 1) {
            view2();
            exit;
        }
        // require_once('include/header.inc.php');
        genreNavigator($genre_id);
        $list_url = 'index.php?action=view2&thumbnail=0&genre_id=' . rawurlencode($genre_id) . '&order=artist';
        $thumbnail_url = 'index.php?action=view2&thumbnail=1&genre_id=' . rawurlencode($genre_id) . '&order=artist';
    } else {
        if ($filter == '' || $artist == '') {
            $artist = 'All album artists';
            $filter = 'all';
        }
        $query = '';
        if ($filter == 'all') {
            $query = mysql_query('SELECT artist_alphabetic FROM album WHERE 1 GROUP BY artist_alphabetic ORDER BY artist_alphabetic');
        } elseif ($filter == 'exact') {
            $query = mysql_query('SELECT artist_alphabetic FROM album WHERE artist_alphabetic = "' . mysql_real_escape_string($artist) . '" OR artist = "' . mysql_real_escape_string($artist) . '" GROUP BY artist_alphabetic ORDER BY artist_alphabetic');
        } elseif ($filter == 'smart') {
            $query = mysql_query('SELECT artist_alphabetic FROM album WHERE artist_alphabetic LIKE "%' . mysql_real_escape_like($artist) . '%" OR artist LIKE "%' . mysql_real_escape_like($artist) . '%" OR artist SOUNDS LIKE "' . mysql_real_escape_string($artist) . '" GROUP BY artist_alphabetic ORDER BY artist_alphabetic');
        } elseif ($filter == 'start') {
            $query = mysql_query('SELECT artist_alphabetic FROM album WHERE artist_alphabetic LIKE "' . mysql_real_escape_like($artist) . '%" GROUP BY artist_alphabetic ORDER BY artist_alphabetic');
        } elseif ($filter == 'symbol') {
            $query = mysql_query('SELECT artist_alphabetic FROM album WHERE artist_alphabetic  NOT BETWEEN "a" AND "zzzzzz" GROUP BY artist_alphabetic ORDER BY artist_alphabetic');
        } else {
            message(__FILE__, __LINE__, 'error', '[b]Unsupported input value for[/b][br]filter');
        }
        if (mysql_num_rows($query) == 1) {
            $album = mysql_fetch_assoc($query);
            $_GET['artist'] = $album['artist_alphabetic'];
            $_GET['filter'] = 'exact';
            view2();
            exit;
        }
        // formattedNavigator
        $nav = array();
        $nav['name'][] = 'Library';
        $nav['url'][] = 'index.php';
        if ($artist != '') {
            $nav['name'][] = $artist;
        }
        require_once 'include/header.inc.php';
        $list_url = 'index.php?action=view2&thumbnail=0&artist=' . rawurlencode($artist) . '&filter=' . $filter . '&order=artist';
        $thumbnail_url = 'index.php?action=view2&thumbnail=1&artist=' . rawurlencode($artist) . '&filter=' . $filter . '&order=artist';
    }
    ?>
<table cellspacing="0" cellpadding="0" class="border">
<tr class="header">
	<td class="space left"></td>
	<td>Artist</td>
	<td align="right">
	<!--
	<a href="<?php 
    echo $thumbnail_url;
    ?>
"><img src="<?php 
    echo $cfg['img'];
    ?>
small_header_thumbnail.png" alt="" class="small"></a>
	-->
	</td>	
	<td align="right" class="right">
	<!--
	<a href="<?php 
    echo $list_url;
    ?>
"><img src="<?php 
    echo $cfg['img'];
    ?>
small_header_list.png" alt="" class="small"></a>
	-->
	&nbsp;
	</td>	
</tr>

<?php 
    $i = 0;
    while ($album = mysql_fetch_assoc($query)) {
        ?>
<tr class="<?php 
        echo $i++ & 1 ? 'even' : 'odd';
        ?>
">
	<td></td>
	<td colspan="2"><a href="index.php?action=view2&amp;artist=<?php 
        echo rawurlencode($album['artist_alphabetic']);
        ?>
"><?php 
        echo html($album['artist_alphabetic']);
        ?>
</a></td>
	<td></td>
</tr>
<?php 
    }
    echo '</table>' . "\n";
    require_once 'include/footer.inc.php';
}
Example #2
0
File: vektr.php Project: vench/esee
$points = [
	[0,0,0,1,0,0,0],
	[0,1,1,1,1,1,0],
	[0,1,1,0,1,1,0],
	[1,1,0,0,0,1,1],
	[0,1,1,0,1,1,0],
	[0,1,1,1,1,1,0],
	[0,0,0,1,0,0,0],
];
*/
echo "\n";
foreach ($points as $y => $point) {
    foreach ($point as $x => $v) {
        if ($v == 1) {
            $c = makeChain2($points, $x, $y);
            if (is_null($c)) {
                continue;
            }
            //print_r($c);
            view2($c);
            /*
            			//print_r($c);
            			foreach($c as $p) {
            				list($x1,$y1) = $p;
            				echo str_repeat('x', $x1 - 303);
            				echo str_repeat('y', $y1 - 190);
            				echo "\n";
            			}*/
        }
    }
}
        <!-- Une variable $tab_series est donnée -->    
        <div>
            <form enctype="multipart/form-data" method="post" acceptcharset="UTF-8" action="?action=inserting&controller=series">
            <fieldset>
                <legend><?php 
echo $label;
?>
 des Sous-titres:</legend>
                <p>
                <label enctype="UTF-8" for="id_title">Nom de la série</label> :
                    <?php 
echo <<<EOT
                    <input list="series" type="text" value="{$t}" name="title" id="id_title" autocomplete="off" autofocus/>
                    <datalist id="series">
EOT;
view2($tab_series);
?>
                   
                </p>
<?php 
echo <<<EOT
                <p>
                    <label for="id_subtitle">Fichier de Sous-titres</label> :
                    <input type="hidden" name="MAX_FILE_SIZE" value="3000000" />
                    <input type="file" name="subtitles" id="id_subtitle"/>
                </p>
                <input type="hidden" name="action" value="{$act}" />
                <input type="hidden" name="controller" value="series" />                
                <p>
                    <input type="submit" value="{$submit}" />
                </p>