Jump to content

Plugnz13

Members
  • Content Count

    16
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Plugnz13

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Sorry, Barand, I stripped the XML so there wasn't so much detail in the post. I'll repost tonight.
  2. Hi There all, having an issue with simple xml... hopefully someone will be able to shed some light on this. I have this data in an xml feed from an API: <ID>job no 1 </ID> <Name>job name</Name> <State>job status</State> <Tasks> <Task> <Name>task name 1</Name> </Task> <Task> <Name>task name 2</Name> </Task> <ID>job no 2</ID> <Name>job name</Name> <State>job status<
  3. Thank you Barand! That makes so much sense! Really appreciate your help.
  4. Hi There, I'm trying to get the following array to work as a separate include php file to make the HTML easier to follow. Within the HTML it has been working fine, as the "echo $tdata_consent Variable is within the main curly brackets. As soon as I move the variable outside of the brackets I only get 1 item from the array rather than all of the items. $projects_const = array(); $required_const = ['Consent']; $colors_const = array_combine($required_const, ['bg-danger text-white font-weight-bold'] ); $xml_const=simplexml_load_string($jobs_task_response) or die("Erro
  5. Hi Barand, Images to help explain my message to you. As you can see in the main table MC is not assigned to JC1919 Eng Deck, AA1913 Cannell Deck, JC1928 King Alterations, DW1904 Strachan, DW1905 Ohagan but in the dashboard page they are included which is not correct. Thanks again.
  6. Hi mac_gyver, Thanks for your reply. I am starting to accept that the database cache is the best way forward. I'm connecting to a commercial software that has limited functionality and so I'm spending a lot of time on inefficient work-arounds. Initially, It seemed like doubling up as all the data is available through the api, but there is a significant lag in the parsing of the data, which the database would reduce significantly. I am using a database as well so looks like that is the solution. Thanks again.
  7. Hi All, I've been trying to access xml data from an API feed, but it needs a Variable to be passed to an include file without a form. the include is at the header of the page. in the code below, i'm trying to retrieve the variable $project_add from the $xml_2 feed. $proj_add_ID comes from another feed and is being passed ok. foreach ($projects_1 as $proj_1) { $job_no =$proj_1['job_no']; $job_name =$proj_1['job_name']; $job_status =$proj_1['job_status']; $job_staff =$proj_1['job_staff
  8. Hi Barand, Thanks again for your response. I wasn't able to achieve what you had suggested in my script unfortunately. I've attached a screen shot of what it is I'm trying to achieve. Basically in the due date column I want to show the due date of the specific task that is currently shown in the column alongside for that job. The xml file is very long so below is a snippet from one job to give you an idea of how each job is set out. As you can see there is about 9 states each with a different start and due date. So I need to find the due date of the task that matches the job/state.
  9. Hi again, sorry to be a pain but further to the previous question, I have the added requirement to be able to show the due date of a particular task but only if that task-name is the same as the current job state. The xml code looks something like this <Job> <ID></ID> <Name>Job 1</Name> <State>Concept Design</State> <StartDate>2019-02-01</StartDate> <DueDate>2019-10-01</DueDate> <Tasks> <Task> <ID></ID> <Name>Measure Up</Name> <StartDate>2019-0
  10. Thanks Barand and Maxxd, much appreciated. Really need to get my head around how these arrays work.
  11. Hi all, I have a table that shows data from an xml response that has been converted to an array. I have successfully managed to get that to work but it's showing more items than I want. I'm trying to isolate the items by state. There are 11 or so different states, of which I only want 7. I've tried the following with a while loop but I keep getting the message "undefined index: job_status" Here's my code (partial) $projects = array(); $xml=simplexml_load_string($response) or die("Error: Cannot create object"); foreach($xml->Jobs->
  12. That looks exactly like what I need. Thanks Barand! Much appreciated!
  13. Hi There, I'm feeling really dumb but i can't figure out how to get the data from an array that has been converted from xml so I can put it into a table. I've tried looping through based on simple array code but i just get array to string errors. my code looks like this $projects = array(); $xml=simplexml_load_string($response) or die("Error: Cannot create object"); foreach($xml->Jobs->Job as $item) { $projects[] = array( 'job_no' => (string)$item->ID, 'job_name'
  14. Hi All, Sorry to be a pain, but further to the above query, which worked wonders by the way, i now have extended it to select the data based on three situations happening. Basically I want to select the job name and id by the staff member that is assigned to a specific task but only if the state of the job equals that task. echo "<div id='col_3' class='bg-white col-sm-1 border'>"; $jobs_2 = $xml->xpath("Jobs/Job[State= 'Model Drawing' and Type= '$Category' or State= 'Model Drawing' and Tasks/Task/Assigned/Staff/Name= '$Staff' and Tasks/Task/Name= 'Mode
  15. Thanks Phil, That is a super easy fix! much 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.