Jump to content

Archived

This topic is now archived and is closed to further replies.

zsxdcfv21

whats wrong with this????

Recommended Posts

everytime i visit my link, for example this kind of URL http://www.mywebsitehere.com/app/buyer.php?action=notes&BuyerID=1068

case 'notes':

$q = "
SELECT n.BuyerNoteID,
      n.Note,
      date_format(n.Created, '%d %b %y')  nCreated,
      date_format(n.Created, '%d %b %y') nModified
 
FROM BuyerNote n
JOIN Buyer b
  ON b.BuyerID = n.BuyerID
AND b.BuyerID = '{$_GET['BuyerID']}'
JOIN User u
  ON b.UserID = u.UserID
";
if (!$isAdmin)
$q .= " AND u.UserID = '{$_SESSION['UserID']}' ";

$q .=" ORDER BY n.Created DESC";

$db->execute($q);

if ( true == $db->resultHasRows() ) {
require_once('func.buyernote.php');
$notes = '';
while ( false != ($r = $db->getObject()) ) {
$notes .= makeNote($r->BuyerNoteID, nl2br($r->Note), $r->nCreated, $r->nModified);
}
} else {
$notes = 'No Notes to Display.';
}

$o = $db->executeOrDie("
select concat(Firstname, ' ', Surname) Name
from Buyer
where BuyerID = '{$_GET['BuyerID']}'
");

// alterted this 18 august
if (!$isSubAdmin)
$html->setAction("note_add&BuyerID=".$_GET['BuyerID'], 'Add a Note');
$html->setHeading('View Notes for ' . $o->Name);
$html->bindContent($notes);
$html->useBackButton($_SERVER['PHP_SELF']);
$html->printHTML();
$html->serialise();
break;


... it gives me a blank. no errors or whatsoever, its purely blank. the script for 'func.buyernote.php' are the ff:


<?

function makeNote ($id, $note, $created) {
global $isSubAdmin;
$note = <<<endh
<table class="note">
<tr>
<td valign="top" width="75" class="date"><b>$created</b></td>
<td valign="top" class="text" rowspan="2">$note</td>
</tr>
<tr>
<td valign="bottom">
endh;
if ( ! $isSubAdmin )
{
$note .= <<<endh
<a href="buyer.php?action=note_edit&BuyerNoteID=$id">Edit</a> |
<a href="buyer.php?action=note_remove&BuyerNoteID=$id">Delete</a>
endh;
}
$note .= "</td></tr></table><br>";
return $note;
}

?>


can anyone tell me whats wrong??? =(

Share this post


Link to post
Share on other sites
Turn all error reporting on [code=php:0]<?php error_reporting(E_ALL); ini_set('display_errors', 'On'); ?>[/code] and see what you get.

Share this post


Link to post
Share on other sites
Try chnaging this
[code]date_format(n.Created, '%d %b %y')  nCreated,
date_format(n.Created, '%d %b %y') nModified[/code]

to this
[code]date_format(n.Created, '%d %b %y')  as nCreated,
date_format(n.Created, '%d %b %y') as nModified[/code]

I had to do this for a date I was using to format it how i wanted

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.