Jump to content

DeX

Members
  • Posts

    258
  • Joined

  • Last visited

Everything posted by DeX

  1. I'm using Apache2. I can edit anything I like. I am using .htaccess for some URL rewriting. Here is what I got: Request URL:https://development.xxxxxxxx.com/javascript/home.js?version=2 Request Method:GET Status Code:200 OK (from cache) Remote Address:208.118.xxx.xx:443 Response Headers Accept-Ranges:bytes Content-Encoding:gzip Content-Length:11536 Content-Type:application/javascript Date:Mon, 19 Dec 2016 19:02:39 GMT ETag:"1a262-543cb2754e292-gzip" Last-Modified:Fri, 16 Dec 2016 18:58:20 GMT Server:Apache/2.4.18 (Ubuntu) Vary:Accept-Encoding Request Headers Provisional headers are shown Accept:*/* Referer:https://development.xxxxxxx.com/home.php?quote=58534 User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36 Query String Parameters view source view URL encoded version:2 I put version 2 at the end attempting to fool it into thinking it was a new file.
  2. Makes sense. If you're getting cheaper hosting by using shared hosting then your trade-off is that you're sharing it with others and your times are going to be affected. If you want faster mailing then you can pay more for dedicated hosting or you can offload your mailing to a third party script like MailChimp. The choice is really yours, if your client wants faster mail but doesn't want to pay up for it then they can't have it both ways.
  3. Yes, it's a rather expensive Dell server running a pile of virtual machines, one of them being my Ubuntu web server I'm using for this. It sounds like I can change a setting on the server each time I do a deployment.
  4. Oops, I thought it was in milliseconds. You're right.
  5. You appear to be printing the array when what you want to do is return it. Your function isn't actually returning anything so your foreach loop isn't receiving anything.
  6. Based on those numbers I would say the actual sending of the mail is done in a timely manner. I would investigate the mb_send_mail function.
  7. It's an internal portal so you would need a login to see it. Is the caching set in the code? I'm not managing the caching at all currently, I just have the JavaScript functions and I use them. If managing the cache in the code is something I can do then I'll research that and figure out how to set it up. I didn't even know that was possible.
  8. I don't want my users to be able to load all PDF on my system so I verify them with a token and then load their PDF like so: if ($location) { header('Content-Type: application/pdf'); readfile($location); } The problem is when they right click it to save, it tries to save as pdf-loader.php instead of the quote-123.pdf filename. They're trying to save them as the quote numbers so they are easily matched up with each customer quote and they're not the most savvy computer users. Even when using the Chrome menus to select SAVE, it still tries to save the same way.
  9. Each time I deploy new code into production, my users call me that something doesn't work and I have to tell them to refresh their browser to get the latest JavaScript code. Sometimes I even have to walk them through a hard reload and cache deletion before it will work, is there a way to avoid this? How can I force the latest JavaScript to go out to my users on each deployment?
  10. Been checking it out all day, looks like GIT has the advantage of being able to make commits offline since every user has a local repository. Then you have a separate set of commit commands where you can commit your local repository up to the main server copy. This introduces increased complexity though, so many beginner or single user systems are going to work better with Subversion. I've decided to stick with Subversion.
  11. Makes sense, I've been doing a lot of research and it appears I can host my repository in a completely separate folder from my development server web directory. How is GIT better? Back to more research.....
  12. Right now I do all my PHP edits in NetBeans and when I save a file, it automatically uploads it to the development server so I can test. If everything tests correctly, I copy it to production via FTP. I would like to start using Subversion but don't want to lose the convenience of the automatic uploads when saving the file. I would like this process: - saving in Netbeans automatically uploads file to development server for testing - if all testing works out, I commit the changes - if I have done enough commits for a new version release, wrap everything up to be copied to production. The previous company I worked at used tags for this and each tag was named with a version number. I make such frequent small edits to make something work that I would hate to have to go to the command line and commit with a message in order to get something up to the development server in order to test. Does it already work like this or am I using it outside the normal usage? If I do this, where would I hold my repository? In the actual /var/www/website directory with all the development files? Outside that directory somewhere? Thanks a lot.
  13. Actually it appears you may have answered me here already. I'll give the user an option to enter either a direct item or an indirect item and that way I can use Javascript to present them with the options for creating the rules. Man, I'm really excited about this!
  14. Much more of this is making sense now, so I'm going to start creating database tables today and setting things up to accept the new items. Looking at your last paragraph you mention having all of the direct BOM in the database already, does this mean they need to be added for each user input item already and the user is unable to add a new direct BOM and assign it to the input themselves? For example, once all of this is set up, the user may want to add a welcome mat for each building and the sales guy can directly select the quantity on each building they quote, they don't depend on anything else except the direct quantity input. If the guy chooses 3, there are 3 mats. The administrator would add a new direct BOM item for the mat but how does the system know the quantity is attached to that specific input box? Normally the rules would specify the ID of another BOM item this depends on but in this case it doesn't depend on another item with ID, it depends on a specific input. How would the rule look in this case? Would I need a selector when they create the item for them to select if it references another item or a specific input? I feel like this is going to click for me any minute now, I'm so close.
  15. Wow this is great, thank you. 1. This makes total sense, and to build on your point, would I assign the quantity of floor mats to one of the user inputs? I'm assuming that's the very definition of a direct input, is that it uses only the direct inputs and not any other indirect BOM items. 2. I'm not quite sure what you mean by search / select interface, do you mean a drop down box of items from the database? I already have all items in the database so the drop down box is what I had initially thought I would use. Then the user would add a multiplier, an offset and can then add a second or third for the same item if that item is used with multiple other indirect BOM items. Look at me, I'm learning so much from you! It appears that you're associating the tape to the mat in the user interface from the mat side, is this correct? What I mean is it appears you're editing the mat details and adding all of the indirect BOM items that are included when a mat is added. Up until this point I had assumed you would go into the tape and add all direct / indirect BOM items that would have tape associated with them which is essentially backwards from how it appears you're doing it. Am I confused? 3. Again it appears you're editing the items that get included when editing a top level direct item. This would mean you go into MAT and edit all the lower level indirect items it uses. Is this more correct than going into TAPE and editing all the higher level direct items that would include tape? I want to make sure I don't have it backwards, same confusion as point 2. 4. Are you saying I should allow the user to add a new indirect item while adding a different indirect item? Up until now I was assuming I would only add a single indirect item at a time and then add another indirect item that used that first item. I think it would clean up the interface a lot but want to be sure I'm not removing some functionality that would help with something else. Oh wait, maybe I understand it now that I read it again. Are you talking about when setting a rule on an item that uses an indirect item, this is how the indirect item entry would work? I see that, so the user wants to create a rule using an item that doesn't exist yet so they would need some sort of interface to add the indirect item and then use it in the rule they were creating for an existing item. 1. Aha, I get it now! I had thought I was using the current item ID here that we were currently editing. No that's not right, you're saying I should be using the ID of the item that this item relies on and for which the rule is being created. For example when editing tape, you would put the mat ID here and set your multiplier and offset to calculate the quantity of tape per mat. Thanks. 2. So if the user wants to add a floor mat for every 30 feet of building length, how do I populate the drop down list of all direct inputs they can set the rule on? They would need to choose building_length from the drop down and then it would set the rule on that input. Do I just hard code the options they would have in this drop down? I was thinking of putting them all into the database so that the drop down would be populated automatically, then they can also add new inputs on which new direct items can rely. Thanks a lot for this, this will probably help a lot of people searching for this solution in the future.
  16. Two questions about this. 1. You had the rule ID as building_height_adder_item_id but should this be the actual item's ID instead? Should it be the database ID of the scissor lift and not an arbitrary height adder item id? I'm probably not explaining this properly but I was under the assumption that that spot is reserved for all item ID in the database and not the ID of something else so if we're trying to calculate quantities of scissor lifts, it would be the scissor lift ID in that spot. 2. In the last line you state it will show as 1 (because of the offset) if the scissor lift is in the BOM. I'm confused by this because I thought all items would always be in the BOM for every building, the rules would just get a quantity of 0 or more based on the rules associated with that item ID. If the item is not needed for that building (insulation in a non-insulated building), then it calculates a quantity of 0 based on the rules. Is there another part where I'm only adding materials to the BOM if required, based on additional rules?
  17. $lastItem = $yourArray[count($yourArray) - 1]; If your array has 10 items in it, you want to point to index 9 because it's a zero based array (first item is index 0). So you want to point to the count (quantity) of items in the array minus 1.
  18. Okay so in order to allow the user to enter a new item and give them the ability to add it to the direct BOM or the indirect BOM, I would need to give them a list of available inputs in order to tie the multiplier to for the quantity calculations. That means I would need to build the quote inputs from the database. I would also need to give them the ability to add a new input in case they're adding a direct BOM material which relies on an input that doesn't exist yet. Am I correct? I'm very excited to get this going, just want to make sure I'm attacking it correctly before I begin. Thanks a lot.
  19. Another slight addendum, what about for items that do not rely on quantities of other items but rely solely on inputs from the salesman? I see the rules in these examples are for multipliers and offsets used in conjunction with quantities of other existing items but what about things like gable vents which have a quantity input by the sales person on the quote? The quantity of these items is simply the exact number input by the salesman. Nothing more. Most importantly I don't see how the interface would work for this. The input fields are hard coded on the input page, I don't have a list in the database. So for the interface to allow the user to add a new product into the system and base it on a salesman input, that would be quite difficult. I would need to shift all inputs to the database and categorize / order them for how they would display relative to one another.
  20. To test what you're receiving on your ajax.php page, you can print it out with the following somewhere on the page: print_r($_POST); To test and see if your database insert is working at all, try replacing the POST variables with static entries. Once you narrow down where the error is, work on it from there.
  21. Well today is the day I actually start implementing this change in the code and I'm scanning which items I can apply this to and which I can't. I keep focusing on the ones that check to see if the item (door or window) is customer supplied or not and how that would translate. You mentioned above that I could use a multiplier of 1 or 0 to accomplish this but would this be better than separating the customer supplied doors and non-customer supplied doors into 2 separate items? Here is one I'm specifically dealing with right now: case (self::sideWallBeam) : for ($i = 0; $i < count(json_decode($this->overheadQuantities, true)); $i++) if (strtolower($this->getOverheadDoorLocations($i)) == strtolower("Side Wall")) $quantities[] = $this->getOverheadDoorQuantities($i); for ($i = 0; $i < count(json_decode($this->slidingQuantities, true)); $i++) if (strtolower($this->getSlidingDoorLocations($i)) == strtolower("Side Wall")) $quantities[] = $this->getSlidingDoorQuantities($i); break; The salesman enters two 10x12 overhead doors, another 3 10x10 overhead doors and finally a single 10x12 sliding door when doing the quote. For each group of overhead doors, I check to see if that door location is side-wall or end-wall (chosen by salesman) and then add side-wall beams accordingly. My main confusion here resides with the number of options available when adding these doors. They can be customer supplied, end-wall, side-wall and also insulated / non-insulated. Various items depend on each of these attributes when determining if they are required for building the building. Thanks again.
  22. When adding doors, it is always a set number of inputs and they're always the same. The same options are available for every door. Then there are different input options for windows but they're always the same for each window. Then the same for a few other items with a total of about 10 different items like this.
  23. I have a quoting system that some of you may be familiar with from my previous questions, this is another piece of it I'm trying to clean up. The user can add a door or window to the quote and can also associate options with the item. For example, they can add the door, then supply the type of opening mechanism (chain, motor....), then how many windows are in the door, then which storey the door will be installed on. Then they can add another door if they wish. Currently I'm using a jQuery popup like a lightbox (Bootstrap modal dialog) to ask the user all of the proper questions about the door, then when they click the button to save the door, I'm serializing all of the inputs from that lightbox and assigning them to a hidden variable farther down the page. No matter how many doors they add, it all gets serialized into a JSON array into that hidden variable and that variable is submitted to the next page to be saved to the database when the user saves the quote. I know of no other way of transferring all of this data to the next page other than collecting, serializing and submitting as a JSON array. Am I doing it correctly? Thanks.
  24. Actually that code should be this. <div class="row paginate"> <div class="col-12"> <nav> <?php // loop through 5 page numbers for ($i = 1; $i < 6; $i++) { // output initial links and set the page number in a URI variable echo '<a href ="index.php?page=' . $i . '"'; // check URI variable to see if it iss equal to our current iteration count if ($_GET['page'] == $i) echo ' class = "active" '; // output end of link echo '>' . $i . '</a>'; } ?> </nav> </div> </div>
  25. <div class="row paginate"> <div class="col-12"> <nav> <?php // loop through 5 page numbers for ($i = 1; $i < 6; $i++) { // output initial links and set the page number in a URI variable echo '<a href ="index.php?page=' . $i . '"; // check URI variable to see if it iss equal to our current iteration count if ($_GET['page'] == $i) echo ' class = "active" '; // output end of link echo '>' . $i . '</a>'; } ?> </nav> </div> </div> Untested but here is how you would build the pages dynamically. Eventually I would have the photo links in a database and I would look into using mod_rewrite with a .htaccess file so you can have the following: .../photos/2 instead of: .../index.php?page=2
×
×
  • Create New...

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.