+ Post New Thread
Page 10 of 20 FirstFirst ... 67891011121314 ... LastLast
Results 136 to 150 of 287
How do you do....it? Thread, Toner inventory Database in Technical; Cold you copy and paste those two define() lines into here?...
  1. #136

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,406
    Thank Post
    639
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    324
    Cold you copy and paste those two define() lines into here?

  2. #137
    ticker's Avatar
    Join Date
    Mar 2006
    Location
    Waterfoot, Rossendale
    Posts
    298
    Thank Post
    56
    Thanked 20 Times in 17 Posts
    Rep Power
    21
    As requested

    define('DOC_ROOT', realpath(dirname(__FILE__) . '/../'));
    define('URL_ROOT', str_replace ('\\', '/', substr(DOC_ROOT, strlen(realpath($_SERVER['DOCUMENT_ROOT']))) . '/'));

  3. #138

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,406
    Thank Post
    639
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    324
    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/');

  4. Thanks to webman from:

    ticker (19th April 2011)

  5. #139
    ticker's Avatar
    Join Date
    Mar 2006
    Location
    Waterfoot, Rossendale
    Posts
    298
    Thank Post
    56
    Thanked 20 Times in 17 Posts
    Rep Power
    21
    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!

  6. Thanks to ticker from:

    webman (19th April 2011)

  7. #140

    Join Date
    Apr 2011
    Posts
    11
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Quote Originally Posted by webman View Post
    I think you're close! I'd be tempted to create a function for this similar to getQtyStatus() in the consumable model file (or replace that one). The function can return an array of ok/low/critical + the colour based on a) the actual quantity of the consumable, and b) the re-order level for that consumable.

    A sensible place for this would be in the consumable model file. This way, you can call the function on an instance of it, and it will already have access to the data needed.

    So, for example. A consumable with a qty of 6 and a reorder level of 3:

    $this_status = $c->get_status();

    You would then have the info you need in an array like this: Array('ok', '73D216'). $status[0] is the status name, $status[1] is the colour.

    The function could look like some of your code above:

    Code:
    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');
        }
    }
    }
    Or something like that anyway. Just a few ideas...
    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 place
    Code:
    $this_status = $c->get_status();
    in order to call it at the right time?

  8. #141

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,406
    Thank Post
    639
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    324
    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.

  9. #142

    Join Date
    Apr 2011
    Posts
    11
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    I added the following to %root%\inc\classes\Consumable.php:
    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');
    		}
    	}
    But no matter where I called it in %root%\views\home\stock.php , I could not get it to work.
    I ended up trying to just transplant it there, but that did not work either. I am still sitting at line 29 with:
    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;
    		}
    	}
    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..

    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:
    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";
    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.

    Again, thank you so much for sticking with me through this. When I get it finished I will gladly post what I have again.

    So, at present my Reorder page looks like this:
    Last edited by Ctorp; 20th April 2011 at 07:18 PM.

  10. #143
    ticker's Avatar
    Join Date
    Mar 2006
    Location
    Waterfoot, Rossendale
    Posts
    298
    Thank Post
    56
    Thanked 20 Times in 17 Posts
    Rep Power
    21
    Hi Webman

    Now looking at setting up both site jobs and login tracker have you any instructions on setting them up.

    Cheers

  11. #144

    Join Date
    May 2011
    Location
    Saudi Arabia
    Posts
    1
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    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

  12. #145

    RabbieBurns's Avatar
    Join Date
    Apr 2008
    Location
    Sydney
    Posts
    5,521
    Thank Post
    1,333
    Thanked 469 Times in 306 Posts
    Blog Entries
    6
    Rep Power
    199
    @webman I cant seem to figure out how I can delete a printer?

  13. #146

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,406
    Thank Post
    639
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    324
    RabbieBurns: Click on printer name, click red Delete button at bottom of the 'Edit' page

  14. Thanks to webman from:

    RabbieBurns (8th June 2011)

  15. #147

    RabbieBurns's Avatar
    Join Date
    Apr 2008
    Location
    Sydney
    Posts
    5,521
    Thank Post
    1,333
    Thanked 469 Times in 306 Posts
    Blog Entries
    6
    Rep Power
    199
    Aha. Thanks

  16. #148
    eclass's Avatar
    Join Date
    Feb 2011
    Posts
    51
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    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

  17. #149

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,406
    Thank Post
    639
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    324
    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.

  18. #150
    eclass's Avatar
    Join Date
    Feb 2011
    Posts
    51
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    When I click it, It takes me this page that says "simple"

    I attached a screen shot

    one.png

SHARE:
+ Post New Thread
Page 10 of 20 FirstFirst ... 67891011121314 ... LastLast

Similar Threads

  1. OCS Inventory
    By Geoff in forum Downloads
    Replies: 5
    Last Post: 3rd June 2011, 08:40 AM
  2. Inventory
    By school in forum Scripts
    Replies: 2
    Last Post: 3rd June 2010, 02:18 PM
  3. Inventory
    By mmoseley in forum Network and Classroom Management
    Replies: 15
    Last Post: 20th June 2007, 12:31 PM
  4. Replies: 4
    Last Post: 28th February 2007, 09:37 AM
  5. inventory system
    By bjg5858 in forum General Chat
    Replies: 2
    Last Post: 11th July 2006, 09:10 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •