Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Stock and Supplier Notes as on Customer
02-16-2018, 08:04 AM, (This post was last modified: 02-16-2018, 08:05 AM by VortecCPI.)
#4
RE: Stock and Supplier Notes as on Customer
Here is one for Stock Notes...

Code:
CREATE TABLE `stocknotes` (
  `noteid` tinyint(4) NOT NULL AUTO_INCREMENT,
  `stockid` varchar(10) NOT NULL DEFAULT '0',
  `href` varchar(100) NOT NULL,
  `note` text NOT NULL,
  `date` date NOT NULL DEFAULT '0000-00-00',
  `priority` varchar(20) NOT NULL,
  PRIMARY KEY (`noteid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

PHP Code:
echo '<a href="' $RootPath '/AddStockNotes.php?StockID=' urlencode($StockID) . '">' _('Add a note on this stock') . '</a><br />'

PHP Code:
if ($StockID != '') {
        
// Stock Notes
        
$SQL "SELECT
                    noteid,
                    stockid,
                    href,
                    note,
                    date,
                    priority
                FROM stocknotes
                WHERE stockid='" 
$StockID "'
                ORDER BY date DESC"
;
        
$result DB_query($SQL);
        if(
DB_num_rows($result) <> 0) {
            echo 
'<br /><div class="centre"><img src="' $RootPath '/css/' $Theme '/images/note_add.png" title="' _('Stock Notes') . '" alt="" />' ' ' _('Stock Notes') . '</div><br />';
            echo 
'<table style="width: 45%;">';
            echo 
'<tr>
                    <th class="ascending">' 
_('Date') . '</th>
                    <th>' 
_('Note') . '</th>
                    <th>' 
_('Hyperlink') . '</th>
                    <th class="ascending">' 
_('Priority') . '</th>
                    <th>' 
_('Edit') . '</th>
                    <th>' 
_('Delete') . '</th>
                    <th> <a href="AddStockNotes.php?StockID='
urlencode($StockID), '">' ' ' _('Add New Note') . '</a> </th>
                </tr>'
;
            
$k 0;// row colour counter
            
while ($myrow DB_fetch_array($result)) {
                if(
$k == 1) {
                    echo 
'<tr class="OddTableRows">';
                    
$k 0;
                }
// $k == 1
                
else {
                    echo 
'<tr class="EvenTableRows">';
                    
$k 1;
                }
                echo 
'<td>' ConvertSQLDate($myrow['date']) . '</td>
                    <td>' 
$myrow['note'] . '</td>
                    <td><a href="' 
$myrow['href'] . '">' $myrow['href'] . '</a></td>
                    <td>' 
$myrow['priority'] . '</td>
                    <td><a href="AddStockNotes.php?Id=' 
$myrow['noteid'] . '&amp;StockID=' $myrow['stockid'] . '">' _('Edit') . '</a></td>
                    <td><a href="AddStockNotes.php?Id=' 
$myrow['noteid'] . '&amp;StockID=' $myrow['stockid'] . '&amp;delete=1">' _('Delete') . '</a></td>
                    </tr>'
;
            }
// END WHILE LIST LOOP
            
echo '</table>';
        }
// end if there are stock notes to display
        
else {
            if(
$StockID != '') {
                echo 
'<br /><div class="centre"><img src="' $RootPath '/css/' $Theme '/images/note_add.png" title="' _('Stock Notes') . '" alt="" /><a href="AddStockNotes.php?StockID='urlencode($StockID), '">' ' ' _('Add New Note for this Stock') . '</a></div>';
            }
        }



Attached Files
.php   AddStockNotes.php (Size: 7.39 KB / Downloads: 0)
https://www.linkedin.com/in/eclipsepaulbecker
Reply


Messages In This Thread
RE: Supplier Notes as on Customer - by VortecCPI - 02-16-2018, 01:57 AM
RE: Supplier Notes as on Customer - by VortecCPI - 02-16-2018, 04:07 AM
RE: Supplier Notes as on Customer - by afcouling - 03-13-2018, 11:57 PM
RE: Stock and Supplier Notes as on Customer - by VortecCPI - 02-16-2018, 08:04 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)