diff --git a/dashboard/edit_noten.php b/dashboard/edit_noten.php index 0d18416..210752b 100644 --- a/dashboard/edit_noten.php +++ b/dashboard/edit_noten.php @@ -50,10 +50,21 @@ if($action == ''){ $streamlizenz_vorh = "Nein"; } + $result_link = $db->query("SELECT filename + FROM jumi_noten_uploads + WHERE jndid=$row[jndid]"); + $row_link = $result_link->fetch_array(); + if(file_exists($row_link['filename'])){ + $fileexists = 1; + }else{ + $fileexists = 0; + } + $result_rl = $db->query("SELECT $row[anz_lizenzen]-count(*) Rest FROM jumi_noten_zus_saenger_zuord WHERE zsid IN( SELECT zsid FROM jumi_noten_zusammenstellung_zuord WHERE jndid=$row[jndid])"); $row_rl = $result_rl->fetch_array(); + $query1 = "SELECT bezeichnung FROM jumi_noten_zusammenstellung a, jumi_noten_zusammenstellung_zuord b @@ -68,6 +79,8 @@ if($action == ''){ } $songbook = substr($songbook,0,-2); $row['restlizenz'] = $row_rl['Rest']; + $row['link'] = $row_link['filename']; + $row['fileexists'] = $fileexists; $row['songbook'] = $songbook; $row['streamlizenz_vorh'] = $streamlizenz_vorh; $value[] = $row; diff --git a/templates/modern/dashboard/edit_noten.html b/templates/modern/dashboard/edit_noten.html index 3ca2ec5..c59c061 100644 --- a/templates/modern/dashboard/edit_noten.html +++ b/templates/modern/dashboard/edit_noten.html @@ -69,7 +69,7 @@ {section name=table_data loop=$table_data} - {$table_data[table_data].titel} + {if $table_data[table_data].fileexists == 1}{$table_data[table_data].titel}{else}{$table_data[table_data].titel}{/if} {$table_data[table_data].verlag} {$table_data[table_data].songbook} {$table_data[table_data].restlizenz}/{$table_data[table_data].anz_lizenzen}