function showItemInfo(&$clsRpt, $lNumItems, &$items, $lPackageID) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- $attributes = new stdClass(); $attributes->divID = 'aucENPItems'; $attributes->divImageID = 'aucENPItemsDivImg'; openBlock('Items', strLinkView_AuctionItemsViaPID($lPackageID, 'View package items', true) . ' ' . strLinkView_AuctionItemsViaPID($lPackageID, 'View package items', false) . ' ' . strLinkAdd_AuctionItem($lPackageID, 'Add new item', true) . ' ' . strLinkAdd_AuctionItem($lPackageID, 'Add new item', false), $attributes); if ($lNumItems == 0) { echoT('<i>There are no items assigned to this package.</i>'); } else { echoT(' <table class="enpRpt"> <tr> <td class="enpRptLabel"> Item ID </td> <td class="enpRptLabel"> Est. Value </td> <td class="enpRptLabel"> Out-of-Pocket </td> <td class="enpRptLabel"> Name </td> <td class="enpRptLabel"> Provided By </td> </tr>'); $curTotOOP = $curTotEst = 0.0; foreach ($items as $item) { $lItemID = $item->lKeyID; $bBiz = $item->itemDonor_bBiz; $lDonorID = $item->lItemDonorID; $curTotOOP += $item->curOutOfPocket; $curTotEst += $item->curEstAmnt; if ($bBiz) { $strName = strLinkView_BizRecord($lDonorID, 'View business record', true) . ' ' . $item->itemDonor_safeName . ' (business)'; } else { $strName = strLinkView_PeopleRecord($lDonorID, 'View people record', true) . ' ' . $item->itemDonor_safeName; } echoT(' <tr> <td class="enpRpt" style="text-align: center;">' . str_pad($lItemID, 6, '0', STR_PAD_LEFT) . ' ' . strLinkView_AuctionItem($lItemID, 'View auction item', true) . ' </td> <td class="enpRpt" style="text-align: right;">' . number_format($item->curEstAmnt, 2) . ' </td> <td class="enpRpt" style="text-align: right;">' . number_format($item->curOutOfPocket, 2) . ' </td> <td class="enpRpt">' . $item->strSafeItemName . ' </td> <td class="enpRpt">' . $strName . ' </td> </tr>'); } echoT(' <tr> <td class="enpRpt"><b> Total:</b> </td> <td class="enpRpt" style="text-align: right;"><b>' . number_format($curTotEst, 2) . '</b> </td> <td class="enpRpt" style="text-align: right;"><b>' . number_format($curTotOOP, 2) . '</b> </td> <td class="enpRpt"> </td> <td class="enpRpt"> </td> </tr>'); echoT('</table>'); } $attributes = new stdClass(); $attributes->bCloseDiv = true; closeBlock($attributes); }
private function loadImgDocInfoViaContext($enumContext, $imgDoc, $row) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- global $genumDateFormat, $glChapterID; $lFID = (int) $imgDoc->lForeignID; switch ($enumContext) { case CENUM_CONTEXT_CLIENT: $imgDoc->strNameLabel = 'Client'; $imgDoc->strName = strLinkView_ClientRecord($lFID, 'View Client Record', true) . ' ' . str_pad($lFID, 6, '0', STR_PAD_LEFT) . ' <b>' . htmlspecialchars($row->cr_strLName . ', ' . $row->cr_strFName) . '</b>'; $imgDoc->strAddressLabel = 'Address'; $imgDoc->strAddr = strBuildAddress($row->cr_strAddr1, $row->cr_strAddr2, $row->cr_strCity, $row->cr_strState, $row->cr_strCountry, $row->cr_strZip, true); $strPhone = strPhoneCell($row->cr_strPhone, $row->cr_strCell); if ($strPhone != '') { $imgDoc->strAddr .= '<br>' . $strPhone; } break; case CENUM_CONTEXT_PEOPLE: $imgDoc->strNameLabel = 'Name'; $imgDoc->strName = strLinkView_PeopleRecord($lFID, 'View People Record', true) . ' ' . str_pad($lFID, 6, '0', STR_PAD_LEFT) . ' <b>' . htmlspecialchars($row->pe_strLName . ', ' . $row->pe_strFName) . '</b>'; $imgDoc->strAddressLabel = 'Address'; $imgDoc->strAddr = strBuildAddress($row->pe_strAddr1, $row->pe_strAddr2, $row->pe_strCity, $row->pe_strState, $row->pe_strCountry, $row->pe_strZip, true); $strPhone = strPhoneCell($row->pe_strPhone, $row->pe_strCell); if ($strPhone != '') { $imgDoc->strAddr .= '<br>' . $strPhone; } break; case CENUM_CONTEXT_LOCATION: $imgDoc->strNameLabel = 'Client Location'; $imgDoc->strName = strLinkView_ClientLocation($lFID, 'View client location', true) . ' ' . htmlspecialchars($row->cl_strLocation); break; case CENUM_CONTEXT_GRANTPROVIDER: $imgDoc->strNameLabel = 'Funder/Provider'; $imgDoc->strName = strLinkView_GrantProvider($lFID, 'View funder/provider', true) . ' ' . htmlspecialchars($row->gpr_strGrantOrg); break; case CENUM_CONTEXT_INVITEM: $imgDoc->strNameLabel = 'Inventory Item'; $imgDoc->strName = strLinkView_InventoryItem($lFID, 'View inventory item', true) . ' ' . htmlspecialchars($row->ivi_strItemName); break; case CENUM_CONTEXT_AUCTION: $imgDoc->strNameLabel = 'Silent Auction'; $imgDoc->strName = strLinkView_AuctionRecord($lFID, 'View Auction', true) . ' ' . htmlspecialchars($row->auc_strAuctionName) . ' (' . date($genumDateFormat, dteMySQLDate2Unix($row->auc_dteAuctionDate)) . ')'; break; case CENUM_CONTEXT_AUCTIONITEM: $imgDoc->strNameLabel = 'Auction Item'; $imgDoc->strName = strLinkView_AuctionItem($lFID, 'View Auction Item', true) . ' ' . 'item: ' . htmlspecialchars($row->ait_strItemName) . '<br>package: ' . htmlspecialchars($row->ap_strPackageName) . '<br>auction: ' . htmlspecialchars($row->auc_strAuctionName); break; case CENUM_CONTEXT_AUCTIONPACKAGE: $imgDoc->strNameLabel = 'Auction Package'; $imgDoc->strName = strLinkView_AuctionPackageRecord($lFID, 'View Auction Package', true) . ' ' . 'package: ' . htmlspecialchars($row->ap_strPackageName) . '<br>auction: ' . htmlspecialchars($row->auc_strAuctionName); break; case CENUM_CONTEXT_BIZ: $imgDoc->strNameLabel = 'Business/Organization Name'; $imgDoc->strName = strLinkView_BizRecord($lFID, 'View Business/Organization Record', true) . ' ' . str_pad($lFID, 6, '0', STR_PAD_LEFT) . ' <b>' . htmlspecialchars($row->pe_strLName) . '</b>'; $imgDoc->strAddressLabel = 'Address'; $imgDoc->strAddr = strBuildAddress($row->pe_strAddr1, $row->pe_strAddr2, $row->pe_strCity, $row->pe_strState, $row->pe_strCountry, $row->pe_strZip, true); $strPhone = strPhoneCell($row->pe_strPhone, $row->pe_strCell); if ($strPhone != '') { $imgDoc->strAddr .= '<br>' . $strPhone; } break; case CENUM_CONTEXT_SPONSORSHIP: $bBiz = (bool) $row->pe_bBiz; if ($bBiz) { $imgDoc->strNameLabel = 'Sponsor (Business/organization)'; $imgDoc->strName = strLinkView_PeopleRecord($lFID, 'View People Record', true) . ' ' . str_pad($lFID, 6, '0', STR_PAD_LEFT) . ' <b>' . htmlspecialchars($row->pe_strLName . ', ' . $row->pe_strFName) . '</b>'; } else { $imgDoc->strNameLabel = 'Sponsor (Individual)'; $imgDoc->strName = strLinkView_BizRecord($lFID, 'View Business/Organization Record', true) . ' ' . str_pad($lFID, 6, '0', STR_PAD_LEFT) . ' <b>' . htmlspecialchars($row->pe_strLName) . '</b>'; } $imgDoc->strAddressLabel = 'Address'; $imgDoc->strAddr = strBuildAddress($row->pe_strAddr1, $row->pe_strAddr2, $row->pe_strCity, $row->pe_strState, $row->pe_strCountry, $row->pe_strZip, true); $strPhone = strPhoneCell($row->pe_strPhone, $row->pe_strCell); if ($strPhone != '') { $imgDoc->strAddr .= '<br>' . $strPhone; } break; case CENUM_CONTEXT_ORGANIZATION: $imgDoc->strNameLabel = 'Your organization'; $imgDoc->strName = strLinkView_OrganizationRecord($lFID, 'View organization record', true) . ' ' . htmlspecialchars($row->ch_strChapterName); break; case CENUM_CONTEXT_STAFF: $imgDoc->strNameLabel = 'Staff Member'; $imgDoc->strName = strLinkView_User($lFID, 'View staff member record', true) . ' ' . htmlspecialchars($row->strFirstName . ' ' . $row->strLastName); break; case CENUM_CONTEXT_VOLUNTEER: $imgDoc->strNameLabel = 'Name'; $imgDoc->strName = strLinkView_Volunteer($lFID, 'View Volunteer Record', true) . ' ' . str_pad($lFID, 6, '0', STR_PAD_LEFT) . ' <b>' . htmlspecialchars($row->pe_strLName . ', ' . $row->pe_strFName) . '</b>'; $imgDoc->strAddressLabel = 'Address'; $imgDoc->strAddr = strBuildAddress($row->pe_strAddr1, $row->pe_strAddr2, $row->pe_strCity, $row->pe_strState, $row->pe_strCountry, $row->pe_strZip, true); $strPhone = strPhoneCell($row->pe_strPhone, $row->pe_strCell); if ($strPhone != '') { $imgDoc->strAddr .= '<br>' . $strPhone; } break; default: screamForHelp($enumContext . ': image context not currently implemented<br>error on line <b> -- ' . __LINE__ . ' --</b>,<br>file ' . __FILE__ . ',<br>function ' . __FUNCTION__); break; } }
function writeAuctionItemsTable(&$package, &$items, $bDescriptions) { //--------------------------------------------------------------------- // //--------------------------------------------------------------------- $lPackageID = $package->lKeyID; echoT(' <table class="enpRpt"> <tr> <td class="enpRptTitle" colspan="8"> Items in the package <b>"' . $package->strPackageSafeName . '"</b> </td> </tr>'); echoT(' <tr> <td class="enpRptLabel"> item ID </td> <td class="enpRptLabel"> </td> <td class="enpRptLabel"> </td> <td class="enpRptLabel"> Name </td> <td class="enpRptLabel"> Est. Value </td> <td class="enpRptLabel"> Out of Pocket </td> <td class="enpRptLabel"> From </td> </tr>'); $curTotVal = $curTotOOP = 0.0; foreach ($items as $item) { $lItemID = $item->lKeyID; if ($item->itemDonor_bBiz) { $strNameLink = ' <i>(business)</i> ' . strLinkView_BizRecord($item->lItemDonorID, 'View business record', true); } else { $strNameLink = ' ' . strLinkView_PeopleRecord($item->lItemDonorID, 'View people record', true); } echoT(' <tr class="makeStripe"> <td class="enpRpt" style="text-align: center; width: 20pt;">' . str_pad($lItemID, 5, '0', STR_PAD_LEFT) . ' ' . strLinkView_AuctionItem($lItemID, 'View auction item', true) . ' </td> <td class="enpRpt" style="text-align: center;">' . strLinkEdit_AuctionItem($lPackageID, $lItemID, 'Edit Item', true) . ' </td> <td class="enpRpt" style="text-align: center; width: 20pt;">' . strLinkRem_AuctionItem($lPackageID, $lItemID, 'Remove auction item', true, true) . ' </td> <td class="enpRpt" style="width: 140pt;">' . $item->strSafeItemName . ' </td> <td class="enpRpt" style="width: 40pt; text-align: right;">' . number_format($item->curEstAmnt, 2) . ' </td> <td class="enpRpt" style="width: 40pt; text-align: right;">' . number_format($item->curOutOfPocket, 2) . ' </td> <td class="enpRpt" style="width: 110pt;">' . $item->itemDonor_safeName . $strNameLink . ' </td> </tr>'); $curTotVal += $item->curEstAmnt; $curTotOOP += $item->curOutOfPocket; } echoT(' <tr class="makeStripe"> <td class="enpRpt" colspan="4"> <b>Total:</b> </td> <td class="enpRpt" style="width: 40pt; text-align: right;"><b>' . number_format($curTotVal, 2) . '</b> </td> <td class="enpRpt" style="width: 40pt; text-align: right;"><b>' . number_format($curTotOOP, 2) . '</b> </td> <td colspan="2"> </td> </tr>'); echoT(' </table><br>'); }