Prüfen, ob Datei bei Anzeige existiert
This commit is contained in:
parent
e8da596859
commit
de6abfa26c
@ -58,6 +58,11 @@ if($action == ''){
|
|||||||
or die ("Cannot execute query1");
|
or die ("Cannot execute query1");
|
||||||
|
|
||||||
while ($row = $result->fetch_array()){
|
while ($row = $result->fetch_array()){
|
||||||
|
if (file_exists($row['filename'])) {
|
||||||
|
$row['file_exists'] = '1';
|
||||||
|
} else {
|
||||||
|
$row['file_exists'] = '0';
|
||||||
|
}
|
||||||
$value[] = $row;
|
$value[] = $row;
|
||||||
}
|
}
|
||||||
$smarty->assign('table_data', $value);
|
$smarty->assign('table_data', $value);
|
||||||
|
@ -51,6 +51,11 @@ while ($row = $result->fetch_array())
|
|||||||
|
|
||||||
$inner1[$ln2]['id'] = $row2['id'];
|
$inner1[$ln2]['id'] = $row2['id'];
|
||||||
$inner1[$ln2]['filename'] = $row2['filename'];
|
$inner1[$ln2]['filename'] = $row2['filename'];
|
||||||
|
if (file_exists($row2['filename'])) {
|
||||||
|
$inner1[$ln2]['file_exists'] = '1';
|
||||||
|
} else {
|
||||||
|
$inner1[$ln2]['file_exists'] = '0';
|
||||||
|
}
|
||||||
$inner1[$ln2]['originalname'] = $row2['originalname'];
|
$inner1[$ln2]['originalname'] = $row2['originalname'];
|
||||||
|
|
||||||
$dateiarray = explode(".",$row2['originalname']);
|
$dateiarray = explode(".",$row2['originalname']);
|
||||||
|
@ -37,6 +37,11 @@ require_once "../language/german.inc.php";
|
|||||||
or die ("Cannot execute query1");
|
or die ("Cannot execute query1");
|
||||||
|
|
||||||
while ($row = $result->fetch_array()){
|
while ($row = $result->fetch_array()){
|
||||||
|
if (file_exists($row['filename'])) {
|
||||||
|
$row['file_exists'] = '1';
|
||||||
|
} else {
|
||||||
|
$row['file_exists'] = '0';
|
||||||
|
}
|
||||||
$value[] = $row;
|
$value[] = $row;
|
||||||
}
|
}
|
||||||
$smarty->assign('table_data', $value);
|
$smarty->assign('table_data', $value);
|
||||||
|
@ -130,23 +130,29 @@
|
|||||||
<div class="col-12 col-md-8">
|
<div class="col-12 col-md-8">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<table class="table table-striped table-bordered" id="curdoks">
|
<table class="table table-striped table-bordered" id="curdoks">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th style="color:blue; text-align:center;">Datei</th>
|
<th style="color:blue; text-align:center;">Datei</th>
|
||||||
<th style="color:blue; text-align:center;">Uploaddatum</th>
|
<th style="color:blue; text-align:center;">Uploaddatum</th>
|
||||||
<th style="color:blue; text-align:center;">Aktion</th>
|
<th style="color:blue; text-align:center;">Aktion</th>
|
||||||
<tr>
|
<tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{section name=table_data loop=$table_data}
|
{section name=table_data loop=$table_data}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{$table_data[table_data].filename}" target="_new">{$table_data[table_data].originalname}</a></td>
|
<td>
|
||||||
<td>{$table_data[table_data].uploaddatum}</td>
|
{if $table_data[table_data].file_exists == 1}
|
||||||
<td><a class="btn btn-danger btn-rounded btn-icon btn-sm" onclick="delMemberFile({$table_data[table_data].id})"><i class="fa fa-trash" style="width:18px;"></i></a></td>
|
<a href="{$table_data[table_data].filename}" target="_new">{$table_data[table_data].originalname}</a>
|
||||||
</tr>
|
{else}
|
||||||
{/section}
|
{$table_data[table_data].originalname}
|
||||||
</tbody>
|
{/if}
|
||||||
</table>
|
</td>
|
||||||
|
<td>{$table_data[table_data].uploaddatum}</td>
|
||||||
|
<td><a class="btn btn-danger btn-rounded btn-icon btn-sm" onclick="delMemberFile({$table_data[table_data].id})"><i class="fa fa-trash" style="width:18px;"></i></a></td>
|
||||||
|
</tr>
|
||||||
|
{/section}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -256,10 +256,15 @@
|
|||||||
<td class="d-none d-lg-table-cell">{$table_data[table_data].firma}</td>
|
<td class="d-none d-lg-table-cell">{$table_data[table_data].firma}</td>
|
||||||
<td>
|
<td>
|
||||||
{section name=inner loop=$table_data[table_data].inner}
|
{section name=inner loop=$table_data[table_data].inner}
|
||||||
<a href="{$table_data[table_data].inner[inner].filename}" target="_new">
|
{if $table_data[table_data].inner[inner].file_exists == 1}
|
||||||
<div class="d-sm-block d-lg-none mt-0 mb-0">{$table_data[table_data].inner[inner].originalname_short}</div>
|
<a href="{$table_data[table_data].inner[inner].filename}" target="_new">
|
||||||
<div class="d-none d-lg-block mt-0 mb-0">{$table_data[table_data].inner[inner].originalname}</div>
|
<div class="d-sm-block d-lg-none mt-0 mb-0">{$table_data[table_data].inner[inner].originalname_short}</div>
|
||||||
</a>
|
<div class="d-none d-lg-block mt-0 mb-0">{$table_data[table_data].inner[inner].originalname}</div>
|
||||||
|
</a>
|
||||||
|
{else}
|
||||||
|
<div class="d-sm-block d-lg-none mt-0 mb-0">{$table_data[table_data].inner[inner].originalname_short}</div>
|
||||||
|
<div class="d-none d-lg-block mt-0 mb-0">{$table_data[table_data].inner[inner].originalname}</div>
|
||||||
|
{/if}
|
||||||
{/section}
|
{/section}
|
||||||
</td>
|
</td>
|
||||||
<td align="right">{$table_data[table_data].betrag_form}</td>
|
<td align="right">{$table_data[table_data].betrag_form}</td>
|
||||||
|
@ -124,7 +124,13 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{section name=table_data loop=$table_data}
|
{section name=table_data loop=$table_data}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{$table_data[table_data].filename}" target="_new">{$table_data[table_data].originalname}</a></td>
|
<td>
|
||||||
|
{if $table_data[table_data].file_exists == 1}
|
||||||
|
<a href="{$table_data[table_data].filename}" target="_new">{$table_data[table_data].originalname}</a>
|
||||||
|
{else}
|
||||||
|
{$table_data[table_data].originalname}
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
<td class="d-none d-lg-table-cell">{$table_data[table_data].uploaddatum}</td>
|
<td class="d-none d-lg-table-cell">{$table_data[table_data].uploaddatum}</td>
|
||||||
<td><a class="btn btn-danger btn-rounded btn-icon btn-sm" onclick="delNotenFile({$table_data[table_data].id})"><i class="fa fa-trash" style="width:18px;"></i></a></td>
|
<td><a class="btn btn-danger btn-rounded btn-icon btn-sm" onclick="delNotenFile({$table_data[table_data].id})"><i class="fa fa-trash" style="width:18px;"></i></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user