Jump to content

daveoliveruk

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

daveoliveruk's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. No I have my own company. It's just from an email I have been sent by a client and I'm way too busy today to complete, in order to get their business hence why I have posted it on here
  2. 1) Project Details: (be as specific as possible): I have been given a project and would like some help. I am very new to PHP and would like someone to complete the task (see attached). This should be very easy for someone that is good with the language and will also help me understand the methods and syntax a bit more. I am willing to pay whoever wants to help $50 to complete as soon as possible, I need to submit the code today. 2) Payment Amount: $50 3) Payment method/ details (Paypal, check? Timeline?): PayPal __________________________________________________________________________________________________ Scenario We have a client, Freds Clothing, who sell fashion clothing online. Bob has asked us to build an order dispatch system, for sending out customer orders with one of a number of different couriers. At the start of a normal working day, a new batch will be started, and it will be closed at the end of the day, when no more parcels are going to be shipped. This is called the dispatch period. Each parcel sent out with a courier is called a consignment. Each consignment will be given a unique number - each courier will supply an algorithm for generating their own format of consignment numbers. At the end of each dispatch period, a list of all the consignment numbers needs to be sent to each individual courier. The method of data transport varies from courier to courier (e.g. Royal Mail use email, ANC use anonymous FTP). What you should produce Build a class structure to facilitate the implementation of the scenario set out above. Assume that your class library will be given to another developer at a later date to build the interface for the client. The client interface will have three primary functions; 1. Start new batch 2. Add consignment 3. End current batch What we are evaluating We’ll be reviewing your OO analysis and design skills based on the object structure you choose and to some extent your understanding and ability with PHP5 based on the code you produce. Use class/method commenting (ideally phpDoc format) to explain your design decisions. Code re-use, extensibility and maintenance are all important. Notes Make as much progress as you feel you can within the time allowed; you are not required to produce a final product. Do not worry about persistent storage/database abstraction layers/html/visuals – focus on the business logic and class structures.
  3. Thanks for the reply but that wouldn't work with the arrays that I have though, if you see above.
  4. I have a load of the array entries below, what I need to know is how to loop through them making the 'internal name' the id for a select box and the 'options' the options for the select box. Any help would be greatly appreciated!! $data['profile:details'][] = (object)(array( "name" => __gettext("Are you circumsized? "), "internal_name" => "circumsized", "field_type" => "select", "options" => array( 'yes'=>__gettext('Yes'), 'no'=>__gettext('No'), 'na'=>__gettext('Not Applicable')), "description" =>"", "user_type" => "person", "category" => __gettext("Your Personal Information"), "col1" => true, "invisible" => false, "required" => false, )); $data['profile:details'][] = (object)(array( "name" => __gettext("What type of body hair do you have?"), "internal_name" => "body_hair", "field_type" => "select", "options" => array( 'yes'=>__gettext('Yes'), 'no'=>__gettext('No'), 'na'=>__gettext('Not Applicable')), "description" =>"", "user_type" => "person", "category" => __gettext("Your Personal Information"), "col1" => true, "invisible" => false, "required" => false, ));
  5. I have a form with form fields named PROD_1234-2_12_25 etc. I need to loop through the form and any fields that have a value in I ned to strip the PROD_ bit and the bit after the _. For example PROD_1234-2_12_25 would become 1234-2. Can anyone help me? Thanks in advance
  6. No its if(is_array($val)). When I check for an array.
  7. $classRequests is an array returned from an API
  8. I have the following piece of code: foreach($classRequests as $key => $val) { if(is_array($val)){ foreach ($val as $key2 => $val2) { if ($key2 == "UserID") $strIDs2 = add2string($strIDs2, $val2, ','); if ($key2 == "RequestedUserID") $strIDs2 = add2string($strIDs2, $val2, ','); } } else { if ($key == "UserID") $strIDs2 = add2string($strIDs2, $val, ','); if ($key == "RequestedUserID") $strIDs2 = add2string($strIDs2, $val, ','); } } And in the logs I'm getting: [Tue Feb 5 11:57:36 2008] [error] PHP Warning: Invalid argument supplied for foreach() in /home/public_html/menu_home.php on line 589 Is tehre anyway to avoid this? Thanks in advance!
  9. Ok I have the following code: $classmates = $class['ClassMateArray']['ClassMate']; $db = $fbapp->get_table(DB_USER_ID); $friendsSolutions = array(); foreach ($friends as $k => $v) { $classmate = "false"; // get number of class mate postings $user = $db->find($v, 'uid'); if (!isset($user[0])) { $numSolutions = 0; $fid = 0; $registered = false; } else { $fid = $user[0]['bm_id']; $registered = true; foreach ($classmates as $key => $val) { // check if friend is a class mate if ($key == "UserID") { if ($val == $fid) { $classmate = "true"; //$showMsg = "true"; } else { $classmate = "false"; // check if the user is pending here } } // for the removal of class mates if ($key == "ClassMateID") { $cid = $val; } if ($key == "SharingSolutions") { $numSolutions = $val; } } } // add to array $friendsSolutions[] = array( 'fid' => $v, 'bid' => $fid, 'cid' => $cid, 'num' => $numSolutions, 'classmate' => $classmate, 'registered' => $registered ); } Which when there is only one result in the array works fine and returns this: Array ( [0] => Array ( [fid] => 1079553185 [bid] => 168326 [cid] => 66 [num] => 5 [classmate] => true [registered] => 1 ) ) But if there is more than one record in the array it breaks. Anyone have any ideas how to get around this? Any help would be great! PS: I think its along the lines of incrementing this $classmates = $class['ClassMateArray']['ClassMate'][0];
  10. That's great! Thanks for all your help. Another thing, how would I add to this function to see if there is more than one record in the child array?
  11. How do I find out if an array has another (nested) array within it? ANy help would be appreciated!
×
×
  • 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.