Welcome Guest, Not a member yet? Register   Sign In
Ticketing system (sorta)
#1

[eluser]Bionicjoe[/eluser]
I've built the basics of a system to record tickets, but I'm stuck at the updates portion.

A ticket will need to have updates recorded and then displayed in what is basically a blog-comments fashion. I find tutorials on blogs & comments but they are so simple that they're not functional in the real world.

I need a form at the top of the page that shows the ticket info in editable fields that can be updated with a blank 'UPDATE' field.
Below the form I need each previous update listed in non-editable text, like a blog comment.

The form part I got, but I can't put it together with the UPDATE part.

Any good tutorials on this?
#2

[eluser]Eric Barnes[/eluser]
I am not aware of any tutorials off hand however I recently did something similar for a bug tracker.

For the bug details. priority, version, status I used an ajax edit in place script to make it quick and easy to change. Then for comments / replies just created a simple textarea they fill in.

The update part should be very similar to your insert part. Maybe if you can go into more details we might can help more.
#3

[eluser]Bionicjoe[/eluser]
What I need to do is run to different queries on two different tables and display the results on the same page.
I can only get my first query to work.

Code:
function displayoutage()
  {
      $id = $this->uri->segment(3);
      
      //Get the info from the outage table
      $this->load->model('outage_model','',TRUE);
      $this->outage_model->getoutage($id);
      $data['row'] = $this->outage_model->getoutage($id)->result();
        
      // Get the info from the Updates table for this outage
      $this->outage_model->listoutageupdates($id);
      $data['update'] = $this->outage_model->listoutageupdates($id); //Adding '->result();' on the end here causes other errors.
        
      // load template view with $data
      $this->load->view('template_view', $data);

  }

The first query result gets dumped into a little table in the view.
The second query should be displayed at the bottom the page like comments on a blog.
#4

[eluser]Bionicjoe[/eluser]
I solved it!!

Put it all into one big array. (The stupid! It hurts!)

Code:
function displayoutage()
  {

      $this->data = array(
          'row' => $this->outage_model->getoutage($id)->result(),
          'update' => $this->outage_model->listoutageupdates($id),
          'title' => 'Simple Outage View',
        'headline' => 'Simple Outage View',
        'include' => 'outagedisplay_view',
        'footer' => 'Copyright 2010'
          );

    $this->load->view('template_view', $this->data);

However I've hit a new snag. I can only get one item out of my array with a foreach loop. I know the array is good because I did a simple 'print_r($array)', and the loop echos out the HTML once for each item in the array. But I only see the last item.

Code:
print_r($update);

    foreach ($update as $i)
        echo '<hr>';
        echo $i


Sample array from print_r
Code:
Array ( [1] => My first update. [2] => The second update. [3] => Another update. )

The above code spits out a horizontal rule for each item in the array, and then only the last item in the array, in this case 'Another update.'.
#5

[eluser]Bionicjoe[/eluser]
Oh man it's late.

I just deleted the whole thing & retyped it with a bunch of syntax errors. By the time I was done I had found the {} I left out earlier.

$this->FACEPALM Confusednake:




Theme © iAndrew 2016 - Forum software by © MyBB