~hartmut-php/eventum/dashboard

« back to all changes in this revision

Viewing changes to lib/eventum/class.dashboard.php

  • Committer: Hartmut Holzgraefe
  • Date: 2011-07-18 14:31:42 UTC
  • Revision ID: hartmut@php.net-20110718143142-b1737e9e7jtbbuye
added implementation of "last customer replies"

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
    return $result;
37
37
    
38
38
  }
 
39
 
 
40
  function ssc_new_customer_replies() 
 
41
  {
 
42
    $result = array();
 
43
 
 
44
    $query = "SELECT 
 
45
                  sup_iss_id, 
 
46
                  sup_from, 
 
47
                  sup_subject,
 
48
                  sup_date,
 
49
                  now() as now_time
 
50
              FROM 
 
51
               " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "support_email 
 
52
              WHERE 
 
53
                  sup_customer_id > 0 
 
54
              ORDER BY 
 
55
                  sup_date DESC
 
56
              LIMIT 10";
 
57
 
 
58
    $res = DB_Helper::getInstance()->getAssoc($query);
 
59
 
 
60
    foreach($res as $key => $values) {
 
61
      $created = strtotime($values[2]);
 
62
      $current = strtotime($values[3]);
 
63
      $since = Date_Helper::getFormattedDateDiff($current, $created);
 
64
      $result[] = "<a target=':blank' href='view.php?id=$key'>#$key ($since) $values[1]</a>";
 
65
    }
 
66
 
 
67
    return $result;
 
68
  }
 
69
 
39
70
}
 
 
b'\\ No newline at end of file'