C:\xampp\htdocs\kptv2\backup_ro\articole.tpl.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<?php    
    
require_once($LIBPATH "utilfunc.php");
    require_once(
"../conf_/siteconf_.php");
    require_once(
"../admin/dbconn.php");        
    if(
$dbConn) {
        
            
$self="index.php?pg=articole&amp;ord=".$_GET['ord']; //  If you use this code with a different page ( or file ) name then change this 
                    
            // how many rows to show per page
            
$rowsPerPage 5;
             
            
// by default we show first page
            
$pageNum 1;
             
            
// if $_GET['page'] defined, use it as page number
            
if(isset($_GET['page']))
            {
                
$pageNum $_GET['page'];
            }
             
            
// counting the offset
            
$offset = ($pageNum 1) * $rowsPerPage;
            
            if ((isset(
$_GET['ord'])) && (($_GET['ord']) != "")) {
            
$sql_all 'SELECT * FROM articles WHERE (SUBSTRING(NameRO, 1, 1) = "'.$_GET['ord'].'") ORDER BY OrderID';    
            }    
            else {            
                
$sql_all "SELECT * FROM articles ORDER BY NameRO AND OrderID";
            }
            
$result_all = @mysql_query($sql_all);    
            
$num_rows mysql_num_rows($result_all);
        
        if ((isset(
$_GET['ord'])) && (($_GET['ord']) != "")) {
            
$sql 'SELECT * FROM articles WHERE (SUBSTRING(NameRO, 1, 1) = "'.$_GET['ord'].'") ORDER BY OrderID limit ' $offset', '$rowsPerPage;    
        }    
        else {            
            
$sql "SELECT * FROM articles ORDER BY NameRO AND OrderID limit $offset$rowsPerPage";    
        }
                
        
$result = @mysql_query($sql);    
        
$numnow_rows mysql_num_rows($result);
        
    
$articles "";
    if (
$numnow_rows == 0)    {
        
            
$articles "<tr><td align=\"center\" height=\"35\" style=\"padding:10px;\">Momentan nu avem articole cu litera ".$_GET['ord'].".</td></tr>";
            
    }
        else {
    while (
$row mysql_fetch_array($resultMYSQL_ASSOC)) {        
        
$articles .= '
            <tr>
                <td>
                    <table cellpadding="0" cellspacing="0" border="0" summary="" width="100%" style="padding:10px;">
                        <tr>
                            <td '
;
                            if (
$row['ImgID'] !== "")
                                
$articles .=  ""
                                
$articles .= '><b>' $row['NameRO'] . '</b><br>' substr($row['ContentRO'], 0300) . '<br><br><a href="index.php?pg=articol&amp;id=' $row['ID'] . '&amp;ord='.$_GET['ord'].'"><img src="../ro/images/icon-maimult_albume.png" data-srcover="../ro/images/icon-maimult_albume_w.png" alt="Click mai multe albume" style="width:76px;height:20px;border:0"></a></td>';
                            if (
$row['ImgID'] !== "")
                                
$articles .= '<td valign="top" align="right" style="padding-left:10px;padding-bottom:10px;"><a href="index.php?pg=articol&amp;id=' $row['ID'] . '&amp;ord='.$_GET['ord'].'"><img src="../images/articole/' $row['ImgID'] .'" alt="" border="0" style="border: 3px solid #fff; max-width:150px; max-height:120px"></a></td>';
                                
$articles .= '</tr>
                    </table>
                </td>
            </tr>'
;
        
$articles .= "<tr><td><hr></td></tr>";
       }       
                      
            
// how many pages we have when using paging?
            
$maxPage ceil($num_rows/$rowsPerPage);
                         
            
// creating 'previous' and 'next' link
            // plus 'first page' and 'last page' link
             
            // print 'previous' link only if we're not
            // on page one
            
if ($pageNum 1)
            {
                
$page $pageNum 1;
                
$prev " <a href=\"$self&amp;page=$page\">[Anterioara]</a> ";
             
                
$first " <a href=\"$self&amp;page=1\">[Prima]</a> ";
                
$firstNum " <a href=\"$self&amp;page=1\">1</a> ";
            } 
            else
            {
                
$prev  ' [Anterioara] ';       // we're on page one, don't enable 'previous' link
                
$first ' [Prima] '// nor 'first page' link
            
}
             
            
// print 'next' link only if we're not
            // on the last page
            
if ($pageNum $maxPage)
            {
                
$page $pageNum 1;
                
$next " <a href=\"$self&amp;page=$page\">[Urmatoare]</a> ";
             
                
$last " <a href=\"$self&amp;page=$maxPage\">[Ultima pagina]</a> ";
            } 
            else
            {
                
$next ' [Urmatoare] ';      // we're on the last page, don't enable 'next' link
                
$last ' [Ultima pagina] '// nor 'last page' link
            
}
             
            
// print the page navigation link
            //$articles .= "<tr><td align=\"center\" height=\"35\">" . $first . $prev . " Pagina&nbsp;&nbsp;<strong><em>$pageNum</em></strong>&nbsp;&nbsp;din&nbsp;&nbsp;<strong>$maxPage</strong>&nbsp;&nbsp;pagini " . $next . $last."</td></tr>";
            
if ($maxPage 1)
            {
                
$articles .= "<tr><td align=\"center\" height=\"35\">" $first $prev " Pagina&nbsp;&nbsp;";
                    for(
$i=1;$i<=$maxPage;$i++){
                        if (
intval($i) == intval($pageNum)){
                            
$articles .="<strong><em>&nbsp;$i&nbsp;</em></strong>";
                        }
                        else {
                            
$articles .="&nbsp;<a href=\"$self&amp;page=$i\"><strong>$i</strong></a>&nbsp;";
                        }
                    }
                
$articles .= "&nbsp;&nbsp;pagini " $next $last."</td></tr>";
              }    
                  
    }
    
       
//mysql_free_result($result);
        
}
    
$title .="";
    
?>





<td valign="top" style="border-right: 1px solid #5D5C5C" width="589">

    <table cellpadding="0" cellspacing="0" border="0" summary="">
        <tr>

            <td bgcolor="#252525" height="23" width="589" class="adr2"><a href="index.php" class="adr2">Home</a> &raquo; 
            <?php
            
if ($_GET['ord'] == "") {
            echo 
"Legende Rock</td>";
            }
            else {
            echo 
"<a class='adr2' href='index.php?pg=articole'>Legende Rock</a> &raquo; ".$_GET['ord']."</td>";
            }
            
?>
        </tr>

        <tr>
            <td bgcolor="#252525" height="23" class="adr" align="center">
            <a class="adr2" href="index.php?pg=articole&amp;ord=A">A</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a class="adr2" href="index.php?pg=articole&amp;ord=B">B</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a class="adr2" href="index.php?pg=articole&amp;ord=C">C</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a class="adr2" href="index.php?pg=articole&amp;ord=D">D</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a class="adr2" href="index.php?pg=articole&amp;ord=E">E</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a class="adr2" href="index.php?pg=articole&amp;ord=F">F</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a class="adr2" href="index.php?pg=articole&amp;ord=G">G</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a class="adr2" href="index.php?pg=articole&amp;ord=H">H</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a class="adr2" href="index.php?pg=articole&amp;ord=I">I</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a class="adr2" href="index.php?pg=articole&amp;ord=J">J</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a class="adr2" href="index.php?pg=articole&amp;ord=K">K</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a class="adr2" href="index.php?pg=articole&amp;ord=L">L</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a class="adr2" href="index.php?pg=articole&amp;ord=M">M</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a class="adr2" href="index.php?pg=articole&amp;ord=N">N</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a class="adr2" href="index.php?pg=articole&amp;ord=O">O</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a class="adr2" href="index.php?pg=articole&amp;ord=P">P</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a class="adr2" href="index.php?pg=articole&amp;ord=Q">Q</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a class="adr2" href="index.php?pg=articole&amp;ord=R">R</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a class="adr2" href="index.php?pg=articole&amp;ord=S">S</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a class="adr2" href="index.php?pg=articole&amp;ord=T">T</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a class="adr2" href="index.php?pg=articole&amp;ord=U">U</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a class="adr2" href="index.php?pg=articole&amp;ord=V">V</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a class="adr2" href="index.php?pg=articole&amp;ord=W">W</a>&nbsp;&nbsp;&nbsp;&nbsp;    
            <a class="adr2" href="index.php?pg=articole&amp;ord=X">X</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a class="adr2" href="index.php?pg=articole&amp;ord=Y">Y</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a class="adr2" href="index.php?pg=articole&amp;ord=Z">Z</a>&nbsp;&nbsp;&nbsp;&nbsp;
            </td>

        </tr>                

        <?= $articles?>
            
        

    </table>

</td>
x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586