TG SH4RPY
-
Posts
16 -
Joined
-
Last visited
Posts posted by TG SH4RPY
-
-
So it would look like this?
<form method="post" action="class_report_discharges.php">
echo "Search: <input type='text' name='query' size='20'><br>";
echo "<input type='submit' name='search' value='Go!'></form>";
if (isset($_POST['search']))
{
($r['d_name'])
}
-
Well basically i want to add a search function, so i can search by name or status, can anyone help me?
Here's the code :
<?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();
}
//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=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>");
}
}
?>
-
Ill just copy the code into here:
<?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();
}
//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=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>");
}
}
?>
-
there shouldnt be... all i did was went on pastie.org and copied and pasted the code
-
What im trying to do it, as you can see on this code http://www.pastie.org/879737 there is a table on the bottom, i want to add a search feature, so i can search for a members name or search a status, and it will fetch it from that table, can anyone help me out? ive been trying the last few days but cant get it going.
-
Anybody?
-
Hey i cant get it to search for the members, can someone see what ive done wrong?
-
Its the way i got asked to do it?, is it easier to do in HMTL?
-
Hey, Basically Im Trying To Get This Code: http://www.pastie.org/864637
To Open On A Page But It Just Appears Blank, I Cant Spot Any Errors.....
/TG SH4RPY
-
Either by Array or Order By
-
Anyone?
-
Awesome, ive already gotten alot of help from people
-
Im looking for a way to filter the data between the different areas. Probably the best way to filter is by: Honorable Discharge, Dishonorable Discharge, and Validation ( the types of reasons why people are on there)
-
so it looks like this ?
$timestamp = mktime (1,1,1,$date[1],$date[2],print_r($date);
exit;);
-
What does that mean , im kinda new to coding
-
Can someone tell me the error and how the data is exploded. in this code
$this->ipsclass->DB->simple_exec();
while ($row = $this->ipsclass->DB->fetch_row())
{
$date = explode("-",$row[$this->funct->cfield['LEA']['SQL']],3);
$timestamp = mktime (1,1,1,$date[1],$date[2],$date[0]);
$today = getdate();
if (($today[0] - $timestamp) >= (60*60*24*30*6))//60 sec, 60min, 24 hours, 30 days, 6 months
{
$count_validations++;
if ($row[$this->funct->cfield['DIV']['SQL']] == $this->ipsclass->member[$this->funct->cfield['DIV']['SQL']])
{
$count_division++;
}
}
}
I know the error is on line 51, which is in here somewhere
Error line is the following:
$timestamp = mktime (1,1,1,$date[1],$date[2],$date[0]);
Error from the ATS is the following:
Warning: mktime() expects parameter 6 to be long, string given in /home/tghqorg/subsites/twhq/ats/wrapper/modules/info_hud_pending_discharge.php on line 51 -
Hey, im new here and new to coding , trying to learn as much as i can and hoping people can teach me
Need Help Wont Display Members Names
in PHP Coding Help
Posted
Hey,
Im having a problem where it wont show the members name only TBA, i was wondering if anyone could spot whats wrong
Code - http://pastebin.com/8mEGcTqd
page - http://tw.tghq.org/rosters/hto_roster_blistig.php