Hi All,
there are 4 different categories which each month will bw updated. In each category(source ),there are many editions. I have to display 6months updates. its like one is month array which contains 6months' names.
source array contains source of that month.
$table_row conatins editions of particular source.
looking forward to get help from anyone
Thanks
Here is the code.. -
for($i=$current_month; ($num_displayed_months < 5) && ($i >= 0); $i--) {
-
$result_array = array();
-
$num_array = array();
-
$num_total = 0;
-
if($i == 0){
-
$i = $current_month;
-
$current_year = date("Y",mktime(0,0,0,$current_month,1,$current_year-1));
-
}
-
$array = array("Reviewes" => "systematic_reviews" , "Summaries" => "evidence_summary" , "Care Bundles" => "care_bundles" , "Best Practice Information Sheets" => "best_practice");
-
foreach($array as $source => $source_query) {
-
-
$query = "SELECT DISTINCT ID,Title,Authors,Source,Year,Date,pdfURL,htmlURL FROM (\n${$source_query}\n) AS `{$source_query}`\n WHERE Date LIKE '$current_year-%$i-%' ORDER BY Date DESC";
-
$result_array[$source] = mysql_query($query, $dblink) or die(mysql_error() );
-
$num_array[$source] = mysql_num_rows($result_array[$source]);
-
}
-
-
foreach ($num_array as $n) {
-
$num_total += $n;
-
}
-
-
if ($num_total == 0) continue;
-
-
$name = date("F",mktime(0,0,0,$i));
-
$month_text .= "<p><a href ='#$name'>New updates in $name $current_year</a></p>";
-
$month_array = array($month_text);
-
-
foreach($array as $source => $source_query) {
-
$result = $result_array[$source];
-
$num = $num_array[$source];
-
-
if($num){
-
$source_text .= "<p><a href = '#$source'>$source</a></p>";
-
$source_array = array($source_text);
-
-
-
$table_row = array();
-
$table_row[] = "<table class='pretty'>
-
<tr valign='bottom' class='header'>
-
<th>Id</th>
-
<th><p align='left'>Publication Title</p></th>
-
<th><p align='left'>Source</p></th>
-
<th><p align='left'>Authors</p></th>
-
<th><p align='left'>Year</p></th>
-
<th>Date</th>
-
<th>ViewPDF</th>
-
<th>ViewHTML</th>
-
</tr> ";
-
$alternate_row = false;
-
while($row = mysql_fetch_assoc($result)){
-
extract($row);
-
//output table
-
$trclass = ($alternate_row == true)? "even" : "odd" ;
-
$table_row[] = "<tr class = $trclass>";
-
-
$table_row[] = "<td>$ID</td>";
-
$title_URL = $ismember ? (is_null($htmlURL) ? $pdfURL : $htmlURL) : $dsURL;
-
-
$table_row[] = "<td><a href = '$title_URL' onclick='window.open('$title_URL'); return false;'>$Title</a></td>";
-
$table_row[] = "<td>$Source</td>";
-
-
$table_row[] = "<td>$Authors</td>";
-
-
$table_row[] = "<td>$Year</td>";
-
-
$table_row[] = "<td>$Date</td>";
-
if(is_null($pdfURL)){
-
$table_row[] = "<td align='center'>N/A</td>";
-
}
-
else{
-
$pdf_URL = $ismember ? $pdfURL : $dsURL;
-
-
$table_row[] = "<td><a href='<$pdf_URL' onclick='window.open('$pdf_URL'); return false;'><?= generate_img_tag('icon_small_pdf', 17, 17, NULL, 'icon17p') ?></a></td>";
-
-
//<?php
-
} // end if_else
-
if (is_null($htmlURL)) {
-
$table_row[] = "<td align='center'>N/A</td>";
-
}
-
else {
-
$html_URL = $ismember ? $htmlURL : $dsURL;
-
-
$table_row[] = "<td><a href='$html_URL' onclick='window.open('$html_URL '); return false;'><?= generate_img_tag('icon_small_pdf', 17, 17, NULL, 'icon17p') ?></a></td>";
-
-
//<?php
-
} #end if else(is_null($htmlURL))
-
$table_row[] = "</tr>";
-
$alternate_row = !$alternate_row;
-
}# end while()
-
-
$table_row[] = "</table>";
-
/*$display_array = array(
-
"month"=>$month_array,
-
"source"=>$source_array,
-
"table"=>$table_row
-
);
-
*/
-
/*$display_array = array(array(array($month_array)),
-
array(array($source_array)),
-
array(array($table_row))
-
);*/
-
//print_r($display_array);
-
$display_array = array($month_array=>array($source_array=>array($table_row)));
-
print_r($display_array);
-
}# end if($num)
-
}#end foreach()
-
$num_displayed_months++;
-
} #end for()
-
-
I have used below code to declare my multidimensional array..
-
/*$display_array = array(
-
"month"=>$month_array,
-
"source"=>$source_array,
-
"table"=>$table_row
-
);
-
*/
-
/*$display_array = array(array(array($month_array)),
-
array(array($source_array)),
-
array(array($table_row))
-
);*/
-
//print_r($display_array);
-
$display_array = array($month_array=>array($source_array=>array($table_row)));
-
1 1753
my declaration is not working properly...
Need help to delcare multidimensiona ly array
Thanks..
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Charles Banas |
last post by:
i've got an interesting peice of code i'm maintaining, and i'd like to
get some opinions and comments on it, hopefully so i can gain some
sort of insight as to why this works.
at the top of the function (which was translated from Fortran code),
among other heinous and numerous declarations, is this bit:
static float bbuff;
static int bkey;
static int buse;
|
by: SpotNet |
last post by:
Hi NewsGroup;
Trying to construct a Multidimensional (2D more specifically) populated from
an OleDbDataReader. Reason I'm using an ArrayList is I do not know the size
of the first dimension (being rows), here's my final attempt below;
System.Collections.ArrayList GetDataMatrix = New
System.Collections.ArrayList; //Let's just say 10, 3
Keeping it brief and simple excuse the syntax,
|
by: utab |
last post by:
Hi there,
Is there a way to convert a double value to a string. I know that there
is fcvt() but I think this function is not a part of the standard
library. I want sth from the standard if possible.
The thing I am trying to do is to convert a double value to a string
with 8 elements. 8 is fixed because of the files I work with. I will
change this 8 character string with the one(8 character string) already
in the file and so on. But I...
|
by: vito |
last post by:
how to achieve that? it seems php doesn't support it well for a C
programmer?
i hope to use something like:
a;
a;
a;
|
by: Gregory.A.Book |
last post by:
I'm working with displaying and manipulating very large image sets. The
program handles anything from 2D images to 4D RGB volumes in a
time-series. I've been using dynamically allocated arrays to accomplish
this, but having recently added the ability to load and display 4D
data, I've run into some significant performance issues.
For a dataset of size 256x176x176x1, it takes about 30 seconds to
allocate the array. Loading the data into...
| |
by: shadab |
last post by:
I am having big problem retrieving data assgined to dynamic 2-d array .
i am calculating and saving data in to dynamic 2-d array.
but when i retrieve them, it doesnt give correct values.
you can run following code in C compiler and see the difference
follwoing is my code, please have a look and please reply to
sanwa001@fiu.edu
|
by: nivaz |
last post by:
hai friends plz help me in this matter, i want to know really about the declaration of multidimensional array in VB. plz do reply
|
by: ...vagrahb |
last post by:
I am having accessing individual rows from a multidimensional array
pass to a function as reference
CODE:
function Declaration
int Part_Buffer(char (*buffer),int Low, int High)
|
by: Slain |
last post by:
I need to convert a an array to a multidimensional one. Since I need
to wrok with existing code, I need to modify a declaration which looks
like this
In the .h file
int *x;
in a initialize function:
x = new int;
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |