* Pentru mai multe informatii in legatura cu plata, promovarea si creditarea cursurilor va rugam sa dati click aici'; if ($access=='admin' || $access=='profesor') echo ''; echo '
'; if (!isset($_GET['page'])) $page=1; else $page = intval($_GET['page']); if ($page<1) $page=1; $res = array_pop(mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `cursuri` WHERE `STARE` = \'0\'',$link))); $pages = (int)ceil($res/$perpage); $resp = 'Pagina: '; if ($pages>1) { for ($i=1;$i<=$pages;$i++) if ($page==$i) $resp.='['.$i.'] '; else $resp.=''.$i.' '; $pages = $resp; } else { unset($pages); } $page = ($page-1)*$perpage; } $fields = array( 'Denumire'=>'nume', 'Creditat de'=>'creditat', 'Credite'=>'puncte', 'Lector'=>'lector', 'Adaugat la'=>'data'); if (isset($_GET['cautare']) && strlen($_GET['cautare'])>2) { if ($access=='admin') $sql = 'SELECT * FROM `cursuri` WHERE MATCH (nume, FREETEXT, descriere, lector) AGAINST (\''.mysql_real_escape_string(urldecode($_GET['cautare'])).'\' IN NATURAL LANGUAGE MODE)'; else $sql = 'SELECT * FROM `cursuri` WHERE `STARE` = \'0\' AND MATCH (nume, FREETEXT, descriere, lector) AGAINST (\''.mysql_real_escape_string(urldecode($_GET['cautare'])).'\' IN NATURAL LANGUAGE MODE)'; } else { $sql = 'SELECT * FROM `cursuri` '; if ($access=='profesor') $sql.='WHERE (`STARE` = \'0\' OR `STARE` = \''.$userid.'\') '; elseif ($access!='admin') $sql.='WHERE `STARE` = \'0\' '; $sql.= 'ORDER BY `STARE` DESC,'; if (isset($_GET['sort']) && in_array($_GET['sort'],$fields)) { $sql.='`'.mysql_real_escape_string($_GET['sort']).'`'; if (isset($_GET['inv'])) $sql.=' DESC '; else $sql.=' ASC '; } else $sql.='`UID` ASC '; $sql.= 'LIMIT '.$page.', '.$perpage;; } $res = mysql_query($sql,$link); unset($sql); if (mysql_num_rows($res)) { echo ''; if ($access=='admin') unset($fields['Creditat de']); echo ''; foreach ($fields as $f=>$ff) echo ''; //if ($access=='admin') echo ''; echo ''; $xx=0; while ($r = mysql_fetch_array($res)) { $xx++; $r['data'] = date('d/m/Y',$r['data']); if (intval($r['puncte']) == floatval($r['puncte'])) $r['puncte'] = intval($r['puncte']); echo ''; $x=true; foreach ($fields as $f=>$ff) if ($x) { $x = false; if ($access=='admin' && $r['STARE']>0) { $utilizator = mysql_query('SELECT CONCAT(`name`, \' \', `prenume`) AS `nume` FROM `users` WHERE `uuid` = \''.mysql_real_escape_string($r['STARE']).'\' LIMIT 1',$link); $utilizator = @mysql_fetch_array($utilizator); } if ($access=='admin') echo ''; elseif ($r['STARE']==$userid && $access=='profesor') echo ''; else echo ''; } else { echo ''; } //if ($access=='admin') echo ''; echo ''; } echo '
'.$f.'Optiuni
'.$r[$ff].''.($r['STARE']!='0'?($r['STARE']=='-1'?' [ascuns]':' [ in curs de editare de catre '.$utilizator['nume'].' ]'):'').''.$r[$ff].' [ in editare ]'.$r[$ff].''.$r[$ff].''. //''. //''. //'
'; } else { echo '
Nu am gasit niciun curs
'; } if (isset($pages)) echo '

'.$pages.'

'; if (isset($_GET['ajax'])) die(); echo '

* Pentru mai multe informatii in legatura cu plata, promovarea si creditarea cursurilor va rugam sa dati click aici'; echo '
'; $nc=true; include('footer.php'); ?>