Jump to content

blmg2009

Members
  • Posts

    61
  • Joined

  • Last visited

Everything posted by blmg2009

  1. Thank you for your reply I saw this method before on another system however, when you get two customers with the same name but are actually different people it will merge they orders together. I know the odds of that happening is rare but it has happened before to me and the system I was using at the time merged two different customers orders together as they shared the same name. Then I asked the admins to also match the post codes which worked well, however the orders also come from other marketplaces such as Amazon which format the customer names differently to my web store. Therefore it's helpful to manually check the orders you are merging.
  2. I would be stacking them, I can see the example table doesn't show this as I quickly knocked this up to try to explain the intentions of the code. Currently I'm working on the best way to choose the 1 single order_id out of the selected orders, I'm thinking the lower value id. Then it'll do the dimensions calculations and then it will remove the other order_ids from the $orders array. This part is the part i'm struggling, I'm fairly new to programming so I want to use the best practices; I don't want to be creating junk code
  3. This is because the code above is for a dispatch manager; So orders will often get merged together when packed, the data will still remain in the database but we only want a single record for each parcel shipped as orders will be sent in one parcel not multiple parcels. The orders & merged orders will then be uploaded to our courier site, if left un merged the pickers and packers will have extra shipping labels for the orders which they have merged into one box. Therefore this way we can solve this issue before uploading the data files to the courier's website.
  4. Hi guys; I have an array on orders ($orders) which I loop through using foreach to create a table of orders from customer each order has it's own checkbox in the table. I'm wanting to build a method to merge the selected orders length, width, height and weight using the checkbox for orders in the table which have been made by the same person. I need a way to select which order_id is going to contain / update the merged data from the other orders, then the excess order_id(s) will need to be removed from the main $orders array. Here's an example of the table and data: $orders array produces the table ◻ ID CUSTOMER PRODUCT LENGTH WIDTH HEIGHT WEIGHT ◻ 1 Joe Bloggs iPhone 10 5 5 230 ◻ 2 John Smith Macbook 20 20 10 800 ◻ 3 Joe Bloggs Mouse 5 5 5 100 ◻ 4 Terry Fry USB 2 2 2 50 ◻ 5 Ben Tanner Charger 10 10 10 400 i would need to select the two orders from Joe bloggs and merge them, I need a way to decide which order_id will contain the merged data for example the lower value order maybe, then it would need to remove them from the $orders array To get the following ◻ ID CUSTOMER PRODUCT LENGTH WIDTH HEIGHT WEIGHT ◻ 1 Joe Bloggs iPhone 15 10 10 330 ◻ 2 John Smith Macbook 20 20 10 800 ◻ 4 Terry Fry USB 2 2 2 50 ◻ 5 Ben Tanner Charger 10 10 10 400 I'm seeking advice on the best way to go about this, any help would be greatly appreciated.
  5. Thank you for your responses guys, I have solved the issue with the following: public function checkForMultipleOrders($post_code, $first_name, $last_name, $orders){ $orders = implode(',', $orders); $query = $this->db->query("SELECT `order_id` FROM " . DB_PREFIX . "order WHERE `order_id` IN(" . $orders . ") AND `shipping_postcode`='" . $post_code . "' AND `shipping_firstname`='" .$first_name . "' AND `shipping_lastname`='" . $last_name . "'"); return $query->num_rows; }
  6. I would usually use: WHERE `order_id` IN (' . implode(',', array_map('intval', $array)) . ')'; but my array is not like array(1,2,3); it's like the following [0] => 3 [1] => 2 [2] => 1 Which I'm struggling to find the correct way to check
  7. Please use the code tags [ code ] [ / code ] when pasting code on the forum it makes it easier to read. Like such: <?php $iKolommen = 5; ?> <?php include_once("config.php"); ?> <?php $rQuery = mysql_query("SELECT * FROM " . $pre . $sqlgame . " WHERE (name LIKE '%candy crush%') OR (name LIKE '%goodgame farmer%') OR (name LIKE '%rummy%') OR (name LIKE '%goodgame empire%') OR (name LIKE '%Gorillaz Tiles%') OR (name LIKE '%goodgame shadow kings%') OR (name LIKE '%my free zoo%') OR (name LIKE '%my free farm%') OR (name LIKE '%kapi hospital%') OR (name LIKE '%garbage garage%') OR (name LIKE '%11 legends%') OR (name LIKE '%dansen met de sterren%') OR (name LIKE '%skyrama%') OR (name LIKE '%seafight%') OR (name LIKE '%battlestar galactica%') OR (name LIKE '%pirate storm%') OR (name LIKE '%rising cities%') OR (name LIKE '%zoo mumba%') OR (name LIKE '%drakensang online%') OR (name LIKE '%uptasia%') ORDER BY RAND() LIMIT 5"); $iCount = mysql_num_rows($rQuery); ?> <?php if(!$iCount) { ?> <span style="color: white; text-align: center;">No games were found.</span> <?php } else { ?> <table width="780" cellpadding="0" cellspacing="0" align="center"> <tr> <?php $i = 1; while($aGame = mysql_fetch_assoc($rQuery)) { ?> <td width="<?php echo (100 / $iKolommen); ?>%" align="center" style="text-align: center;"> <?php if($aGame['cijfer'] != 0 AND $aGame['stemmen'] != 0) { $iCijfer = floor($aGame['cijfer'] / $aGame['stemmen']); } else { $iCijfer = 0; } $sSpelUrl = str_replace(" ", "-", $aGame['name']); ?> <div style="float: left; margin-left:2px; width: <?php echo ($i == 2 OR $i == 3) ? "152" : "153"; ?>px; text-align: center;"> <a target="_blank" href="http://www.crocgame.com/games.php/<?php echo $sSpelUrl; ?>.html" class="recommendedLink"> <span class="iconwrapper"><img src="<?php echo $aGame['screenshoturl']; ?>" width="140" height="89" alt="recommend games" /></span> <span class="recomendedButton" style="margin: 5px auto auto auto;"> <?php echo strlen($aGame['name']) > 19 ? substr($aGame['name'], 0, 19) . ".." : $aGame['name']; ?> </span> </a> </div></td> ?> From what I gather from your description it sounds like you need javascript help not PHP. You can always google rotating images javacript or jquery and you should find some helpful info here.
  8. Hi guys, I'm using Opencart as my webstore framework; I'm currently building a dispatch manager that will allow me to download the orders into csv files which will be later uploaded to my couriers website. In my controller I have the following array of selected orders to be sent to the dispatch manager if (isset($this->request->post['selected'])) { $orders = $this->request->post['selected']; } elseif (isset($this->request->get['order_id'])) { $orders[] = $this->request->get['order_id']; } Then in my model I have the following: public function checkForMultipleOrders($post_code, $first_name, $last_name, $orders){ $query = $this->db->query("SELECT `order_id` FROM " . DB_PREFIX . "order WHERE `shipping_postcode`='" . $post_code . "' AND `shipping_firstname`='" .$first_name . "' AND `shipping_lastname`='" . $last_name . "'"); } What I need help with is how best to work out how many orders are by the same person i.e multiple order: 1 of 3; However I need to only look for the above parameter with order_id that have been selected and are present in the $orders array. This is to stop the model finding old orders the person may have place weeks or months ago which have already been shipped. Any help on this issue would be greatly appreciated
  9. Thank you guys for your response. The data extracted is just product results page from my suppliers; I'm creating one page to search all my suppliers to see who supplies the part number I'm looking for to save my having to try the same part number on each website. Unfortunately these websites aren't the most advance so will not have an API. I will ask permission before extracting any results from the search.
  10. Is it possible to log into another website maybe by using cURL and then using there search feature and extract the information. Or would this not be possible as the sessions created when logging into the site not correctly save / register.
  11. Hi Guys, I'm fairly new to website development and I'm fully self taught. Since many people are now self taught within the industry we seem to lack the know how about how to effectively plan a website or web project. Being self taught I often plan things in my head then note things down, I kind of go with the flow. However much time can be wasted in doing this as I find myself thinking of what to do next, or even making mistakes because I haven't properly planned my web project. I have bought many books on website planning and done research into stages of development such as wireframes. However there is a lot of things to go through and many of the books contradict each other with there methods and processes. I'm asking for ideas of what sort of things I need to be looking at to successfully plan and execute and entire dynamic website with a database. (Kind of like how a professional company would for one of it's clients.)
  12. I'm wanting to create a foreach loop to loop through a number of mysql tables. With each foreach loop I wish to have a a number of FOR loops counting to 64, 32, 16 and 8 to insert that number times into that table. Is this possible?
  13. I would suggest setting up a free hosting account using freehostia or something; Then use a free sub domain and test your code there; It's most likely you've not correctly set up your testing enviroment.
  14. I'm currently learning PHP so I'm a noob; I'm looking at looping form 1 to 64 and on each loop echoing out html to build a table. This I can do easily. However I also want to add in some PHP in the output of each loop; However I'm not sure how I would do this correctly. for ($i = 1; $i <= 64; $i++) { echo <div class="col-xs-3 team_box top-team-border"><?php echo $results->get_team('64', '<?php echo $i; ?>', 'A', 'main'); ?> <span class="badge"><?php echo $results->get_score('64', '<?php echo $i; ?>', 'A', 'main'); ?></span></div> }
  15. Currently i'm thinking of running the total for both columns and then adding them, but is there a better way?
  16. Hi there, I'm currently teaching myself PHP and MYSQL, so I'm struggling to think of the way to do the following: I have a table for order_products, this includes a list of all products on a customers order. I have two fields in this table that are price & tax I need to add these to values together to get a total but I also need to run a total all all the products in that order, so for example: Order_product_id order_id Price Tax 1 4 30.00 5.00 Order_product_id order_id Price Tax 2 4 20.00 7.00 Order_product_id order_id Price Tax 3 4 10.00 5.00 I have added all the values of a single field before but never had to add two fields together and get all other totals If anyone has the answer to my problem it would be greatly appreciated Thanks for reading.
×
×
  • 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.