Cold you copy and paste those two define() lines into here?
Printable View
Cold you copy and paste those two define() lines into here?
As requested
define('DOC_ROOT', realpath(dirname(__FILE__) . '/../'));
define('URL_ROOT', str_replace ('\\', '/', substr(DOC_ROOT, strlen(realpath($_SERVER['DOCUMENT_ROOT']))) . '/'));
Remove the second line for URL_ROOT, and replace it with the one I included in my previous post. You should then have two lines that look like this:
Code:define('DOC_ROOT', realpath(dirname(__FILE__) . '/../'));
define('URL_ROOT', '/printmaster/');
spot on it work thanks, its a great piece of software. Might also try the site jobs one as well once i have entered all 80 odd printers!
I think this has moved over my head in terms of my knowledge of Flourish and PHP. (I'm still newish to PHP.)
Where is the consumable model file located? I tried doing a directory search for getQtyStatus(), but did not find it.
Supposing that the get_status() function works, where would you placein order to call it at the right time?Code:$this_status = $c->get_status();
All model files are in the inc/classes folder. The one for consumables is Consumables.php.
You would then call that function anywhere you need to know the status of a consumable - e.g. on the home page for the list, and in the consumable listing page.
I added the following to %root%\inc\classes\Consumable.php:
But no matter where I called it in %root%\views\home\stock.php , I could not get it to work.Code:/**
* Get Status of Consumable
*/
static public function get_status(){
$qty = $this->getQty();
$reorder = $this->getReOrder();
if ($qty > $reorder) {
return array('ok', '73D216');
}
if ($qty <= $reorder && $qty > 0) {
return array('low', 'EDD400');
}
if ($qty == 0) {
return array('critical', 'CC0000');
}
}
I ended up trying to just transplant it there, but that did not work either. I am still sitting at line 29 with:
In the meantime, I've set up the printer addedit page ( %root%\views\printers\addedit.php ) with a snippet that adds a checkbox to indicate Inactive/Active status for the inventory. This works, but is not implemented with any functionality yet..Code:foreach($status as $k => $v){
$qty = $c->qty;
$reorder = $c->reorder_pt;
# if ($qty > $reorder) { return array('Ok', '73D216'); }
# if ($qty <= $reorder && $qty > 0) { return array('Low', 'EDD400'); }
# if ($qty == 0) { return array('Critical', 'CC0000'); }
if($c->qty >= $k){
$qtylevel = strtolower($v[0]);
$qtycol = $v[1];
break;
}
}
So I am trying to establish a way for the reorder page ( %root%\reorder.php ) to NOT query consumables that belong to an inactive printer, but my query seems to break when I try it. I have:
I also removed the snippet of code that was allowing a full row to be treated as a selectable item for the checkboxes in %root%\views\consumables\addedit.php. The formatting looks the same, but I kept inadvertently selecting multiple items when scrolling the page so now only clicking the name or checkbox will select it, instead of being able to click the empty row space.Code:$sql = "SELECT
consumables.*, printers.active,
( round( ( (consumables.qty) / (SELECT MAX(qty) FROM consumables) ) * 100 ) ) AS qty_percent,
GROUP_CONCAT(CAST(CONCAT(manufacturers.name, ' ', models.name) AS CHAR) SEPARATOR ', ') AS model
FROM consumables, printers
LEFT JOIN consumables_models ON consumables.id = consumables_models.consumable_id
LEFT JOIN models ON consumables_models.model_id = models.id
LEFT JOIN manufacturers ON models.manufacturer_id = manufacturers.id
WHERE printers.active = 0
GROUP BY consumables.id
ORDER BY models.name ASC, consumables.name ASC";
Again, thank you so much for sticking with me through this. When I get it finished I will gladly post what I have again. :cool:
So, at present my Reorder page looks like this:
http://i.imgur.com/Y0hFQ.jpg
Hi Webman
Now looking at setting up both site jobs and login tracker have you any instructions on setting them up.
Cheers
Hi Webman,
it is nice and simple way to track cartridge inventory , if any one would help me to do some minor things , it would be nice if I can add a comment in adding Consumable , and to be able to see it at reports section , and to have filtering for the reports like Consumable,Printer and Model
@webman I cant seem to figure out how I can delete a printer?
RabbieBurns: Click on printer name, click red Delete button at bottom of the 'Edit' page :)
Aha. Thanks :)
love this script however I can't seem to figure out how to update the ink consumable stock number, my stock number is currently grayed out and cant edit it. Any ideas
Thanks
eclass: To update quantity of consumable stock, use the right side of the home page. Click the yellow box icon next to the toner you want to add, and enter the quantity in the popup dialog box.
When I click it, It takes me this page that says "simple"
I attached a screen shot
Attachment 10848