Maybe I should also elaborate where I get the data from.
This is how the data is fetched and proccessed:
# In the main script:
my @ReturnValues;
my @AdminValues;
my @AdminTime;
my @AdminEndDate;
Admin(\@ReturnValues, \@AdminValues, \@AdminTime, \@AdminEndDate);
# This is the code in sub Admin:
my $sql = "SELECT DISTINCT user_id, realname FROM database.time_data W
+HERE version='$Version' AND product_id='$ProductID' AND milestone='$M
+ileStone'";
my $sth = $dbh->prepare($sql);
$sth->execute();
while(my @RowAdmin = $sth->fetchrow_array())
{
my %AdminData;
$AdminData{"UserID"} = $RowAdmin[0];
$AdminData{"RealName"} = $RowAdmin[1];
# Insert them into hash
push (@$AdminValues, \%AdminData);
}
# Get the stored days
$sql = "SELECT DISTINCT day FROM database.time_data WHERE version='$Ve
+rsion' AND product_id='$ProductID' AND milestone='$MileStone'";
$sth = $dbh->prepare($sql);
$sth->execute();
while(my @RowTime = $sth->fetchrow_array())
{
my %AdminTimeData;
$AdminTimeData{"Day"} = $RowTime[0];
push (@$AdminTime, \%AdminTimeData);
my $sql2 = "SELECT app_end FROM database.time_data WHERE day='$AdminTi
+meData{'Day'}' AND version='$Version' AND product_id='$ProductID' AND
+ milestone='$MileStone'";
my $sth2 = $dbh->prepare($sql2);
$sth2->execute();
while(my @RowTime2 = $sth2->fetchrow_array())
{
my %AdminAppEnd;
$AdminAppEnd{"AppEnd"} = $RowTime2[0];
push (@$AdminEndDate, \%AdminAppEnd);
}
}
$sth->finish();
$dbh->disconnect();
# Back in the main script:
# Pass Values to template
$vars->{'ReturnValues'} = \@ReturnValues;
$vars->{'AdminValues'} = \@AdminValues;
$vars->{'AdminTime'} = \@AdminTime;
$vars->{'AdminEndDate'} = \@AdminEndDate;
How the data is then proccessed in the template can be seen in the first Post. I hope this helps a bit.
Regards
Fred
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|