Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<?php
if ( ! defined( 'IN_IPB' ) )
{
  print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
  exit();
}

print ("<center> 
      Discharged Member's Search:
      <input type='text' name=\"discharged_member_search_name\" size=26 value=\"{$this->ipsclass->input['search_name']}\">
      <input type='submit' name='start_search' value='Search'>
      </center>
      <br />");

      if ( ($this->ipsclass->input['search_name'] != "" and $this->ipsclass->input['start_search'] != NULL) or ($this->ipsclass->input['nextpage'] != "" and $this->ipsclass->input['nextpage'] != NULL) )
    {
      if ($this->ipsclass->input['nextpage'] == 'Next')
      {
        $page = $this->ipsclass->input['search_page'] + 1;
      }
      elseif ($this->ipsclass->input['nextpage'] == 'Prev')
      {
        $page = $this->ipsclass->input['search_page'] - 1;
      }
      else
      {
        $page = 1; 
      }

      //run the search routine here to show results
      $results = $this->funct->searchby_name($this->ipsclass->input['search_name'],$page);
      if ($results == NULL)
      {
        print ("No Results found for '{$this->ipsclass->input['search_name']}'. Try narrowing your search...  <br />");
      }
      else
      {
        print ('<table>');
        $counter = 1;
        foreach ($results as $key => $row)

        print ("</table><br />");

        if ($page != 1)
        {
          print ("<input type='submit' name='nextpage' value='Prev'> Page $page
            <input type='hidden' name=\"search_page\" value='$page'>");
        }
        else
        {
          print ("Page $page
            <input type='hidden' name=\"search_page\" value='$page'>");
        }
        if ($counter > 25)
        {
          print("<input type='submit' name=\"nextpage\" value='Next'>");
        }
      }
    }
//All reports run inside the load_options ATS Form - don't setup any others unless your intention is to run outside of the ATS wrapper and security
class ats_mod
{
  var $ipsclass; //store the IPB super class object for use
  var $funct;  //load the common functions object (had to be an object so we can pass it to other class objects later)
  
  function run_me()
  {
    $query_where = "d_name LIKE '%'";
    $id_remember = "";
    if ($this->ipsclass->input['show'] != Null)
    {
      $g_showa = explode(" ", $this->ipsclass->input['show']);
        
      $id_remember = "&show=" . $this->ipsclass->input['show'];
      $query_where = "";
      $show_count = count($g_showa);
      foreach ($g_showa as $key => $value)
      {
        $query_where .= "d_id = $value";
        if ($show_count > 1)
        {
          $query_where .= " OR ";
        }
        $show_count--;
      }
      
    }
    switch ($this->ipsclass->input['sort']) 
    {
      case 'name' :
        $sort_string = "d_name ASC, d_date ASC";
        break;
      case 'date' :
        $sort_string = "d_date DESC, d_name ASC";
        break;
      case 'ip'  :
        $sort_string = "d_ip ASC, d_name ASC";
        break;
      case 'type' :
      default :
        $sort_string = "d_status ASC, d_name ASC";
        break;
    }
    
    $this->ipsclass->DB->simple_construct( array( 'select' => '*',
                        'from'   => 'members_discharges',
                        'where' => $query_where,
                        'order'  => $sort_string ));
    $this->ipsclass->DB->simple_exec();
  
    print ("<TABLE BORDER CELLPADDING=4>
        <TR ALIGN=CENTER VALIGN=TOP>
        <TH ALIGN=CENTER VALIGN=TOP COLSPAN='7'>{$this->funct->board_name} Discharges and Rejected Validations</TH>
        </TR>
        <TR ALIGN=CENTER VALIGN=TOP>
        <TH><a href='http://{$this->funct->board_site}/index.php?autocom=ats&code=wrapper&ats=run_option&atsmodule={$this->mod_number}&sort=type$id_remember'>Type</a></TH>
        <TH><a href='http://{$this->funct->board_site}/index.php?autocom=ats&code=wrapper&ats=run_option&atsmodule={$this->mod_number}&sort=name$id_remember'>Member Name</a></TH>
        <TH><a href='http://{$this->funct->board_site}/index.php?autocom=ats&code=wrapper&ats=run_option&atsmodule={$this->mod_number}&sort=ip$id_remember'>IP Address</a></TH>
        <TH>Other Known Names</TH>
        <TH NOWRAP><a href='http://{$this->funct->board_site}/index.php?autocom=ats&code=wrapper&ats=run_option&atsmodule={$this->mod_number}&sort=date$id_remember'>Discharge Date</a></TH>
        <TH>Reason(s)</TH>
        <TH>Comments/Details</TH>
        </TR>
        ");
      
  
    while ( $r = $this->ipsclass->DB->fetch_row() )
    {
      $ddate = date("Y-m-d", $r['d_date']);
      $onames = implode(",<BR>\n",explode(",", $r['d_other_names']));
      $reason = implode(",<BR>\n",explode(",", $r['d_reason']));
      if ($r['d_bday_year'] != NULL)
      {
        $reason .= "<BR>\nBirthday:<BR>\n" . $r['d_bday_year'] . "-" . $r['d_bday_month'] . "-" . $r['d_bday_day'];
      }
      $comments = str_replace(array("\r\n", "\n", "\r"), "<br />", $r['d_comments']);
      
      print ("<tr>
          <td>{$r['d_status']}</td>
          <td>{$r['d_name']}</td>
          <td>{$r['d_ip']}</td>
          <td>{$onames}</td>
          <td>{$ddate}</td>
          <td>{$reason}</td>
          <td>{$comments}</td>
          </tr>
      ");
    }
    print("</table>");
  }
}
?>