$licitems++; } elseif ($lictype == 1) { $licitems += $ri[$i]['cpuno']; } elseif ($lictype == 2) { $licitems += $ri[$i]['cpuno'] * $ri[$i]['corespercpu']; } //per core } //items //print a table row $sql = "SELECT invoices.id,invoices.date,agents.title as agtitle FROM invoices, soft2inv, agents " . " WHERE agents.id=invoices.vendorid AND soft2inv.invid=invoices.id AND soft2inv.softid={$r['id']}"; $sthi = db_execute($dbh, $sql); $ri = $sthi->fetchAll(PDO::FETCH_ASSOC); $ninv = count($ri); for ($invinfo = "", $i = 0; $i < $ninv; $i++) { $f = invid2files($ri[$i]['id'], $dbh); $iid = $ri[$i]['id']; $idate = date($dateparam, $ri[$i]['id']); for ($flnk = "", $c = 0; $c < count($f); $c++) { $fname = $f[$c]['fname']; $ftitle = $f[$c]['title']; $flnk .= " <a target=_blank title='View FILE: {$ftitle} {$fname}' href='" . $uploaddirwww . $fname . "'><img src='images/down.png'></a>"; } $invinfo .= "<div style='min-width:70px;'><a title='Edit INVOICE' href='{$scriptname}?action=editinvoice&id={$iid}'><div class='editid'>{$iid}</div><div>{$flnk}</div></a></div>"; $flnk = ""; } //if (!($row%2)) $s=" class='dark' "; else $s=""; ?> <tr> <td><div class='editid'><a title='<?php
?> </a></li> <li><a href="#tab5"><?php te("Upload Files"); ?> </a></li> </ul> <div id="tab1" class="tab_content"> <table class=tbl1 border=0> <?php $d = strlen($date) ? date($dateparam, $date) : ""; //Associated files // $f = invid2files($id, $dbh); //create file links for ($lnk = "", $c = 0; $c < count($f); $c++) { $fname = $f[$c]['fname']; $ftitle = $f[$c]['title']; $fid = $f[$c]['id']; $ftype = $f[$c]['type']; $ftypestr = ftype2str($ftype, $dbh); $fdate = empty($f[$c]['date']) ? "" : date($dateparam, $f[$c]['date']); if (strlen($ftitle)) { $t = "<br>" . t("Title") . ":{$ftitle}"; } else { $t = ""; } $flnk .= "<div class='fileslist' >" . "<a title='Remove association. If file is orphaned (nothing links to it), it gets deleted.' " . " href='javascript:delconfirm2(\"[{$fid}] {$fname}\", \"{$scriptname}?action={$action}&id={$id}&delfid={$fid}\");'>" . "<img src='images/delete.png'></a> " . "<a target=_blank title='Edit File' href='{$scriptname}?action=editfile&id={$fid}'><img src='images/edit.png'></a>" . " <a target=_blank title='Download {$fname}' href='" . $uploaddirwww . $fname . "'><img src='images/down.png'></a>" . "<br>" . t("Type") . ":<b>{$ftypestr}</b>" . "<br>" . t("Date") . ":<b>{$fdate}</b>" . "<br>" . t("Title") . ":{$ftitle}\n" . "</div>\n "; }
?> </th><th><?php te("Description"); ?> </th><th><?php te("Associated Files"); ?> </th></tr> </thead> <tbody> <?php $i = 0; /// print actions list while ($r = $sth->fetch(PDO::FETCH_ASSOC)) { $i++; $f = invid2files($r['id'], $dbh); //create file links $flnk = ""; for ($lnk = "", $c = 0; $c < count($f); $c++) { $fname = $f[$c]['fname']; $fid = $f[$c]['id']; $ftype = $f[$c]['type']; $ftypestr = ftype2str($ftype, $dbh); $ftitle = $f[$c]['title']; if (strlen($ftitle)) { $t = "Title:{$ftitle}"; } else { $t = ""; } $flnk .= "<span style='width:400px' class='fileslist1' >" . "<a target=_blank title='{$ftitle}' href='" . $uploaddirwww . $fname . "'>{$fname}</a>" . " {$t}" . "</span>\n "; }