[PHP-WIN] stuck with substr now .......

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hay guyz

im stuck with substr now

im sure i ve actually lost it ....

i have a string being passed to a graph as its title
and the title is being retrieved from mysql db

now whenever i store anything with <br> or /r/n 
its displayed normally on the screen

but this time i have to pass this to a jpeg chart being created by jd
library
which is then displayed on the screen

and the title gets displayed as

Medicine Reports /r/n (report generated for below 60% stocked
medicines)

where its supposed to display

Medicine Reports 
(report generated for below 60% stocked medicines)


i have tried a few functions but none of them seem to be working

i can, however pass two strings as title and sub-title to the graph
function call

and for this i need to splitt the title retrieved from db to two
strings ......



=================================================================


<?php



//$pg='rprt_gf_py_3d_1';
// ma dta 

$max_data = count($gfData);

for ($k = 0; $k < $max_data; $k++)
{
	//$arrData[$k] = $gfData[$k] * $factor ;
	$data[$k] = $gfData[$k]  ;
}




// Create the Pie Graph.
$graph = new PieGraph(850,600,"auto");
$graph->SetShadow();



	 /*************************
	 trying 2 split title :P:P:P  ! ! ! ! 
	**************************/


$newStr="";
		//Replacing \n with <br>		
		/*$tok = strtok($title,":P");
		while ($tok) {
			$newStr = $newStr.$tok."<br>";
		    $tok = strtok(":P");
		}
		*/
		$tok = split($title,":P");
		//while ($tok) {
			$newStr = $newStr.$tok."<br>";
		    //$tok = substr(":P");
		//}

		echo ($newStr);


//$newStr = explode("\r\n","$title");
//$newStr = explode(chr(10),"$title");
//$newStr = preg_split("/[ \t]+/", $title);






// Set A title for the plot
$graph->title->Set("$newStr");
$graph->subtitle->Set("sub");
$graph->title->SetFont(FF_VERDANA,FS_BOLD,18); 
$graph->title->SetColor("darkblue");
$graph->legend->Pos(0.1,0.2);

// Create 3D pie plot
$p1 = new PiePlot3d($data);
$p1->SetTheme("sand");
$p1->SetCenter(0.4);
$p1->SetSize(150);

// Adjust projection angle
$p1->SetAngle(45);

// Adjsut angle for first slice
$p1->SetStartAngle(45);

// Display the slice values
$p1->value->SetFont(FF_ARIAL,FS_BOLD,11);
$p1->value->SetColor("navy");

// Add colored edges to the 3D pie
// NOTE: You can't have exploded slices with edges!
$p1->SetEdge("navy");


for ($i = 0; $i < $max_data; $i++)
{
	if ($arrData[$i] > $max_value)
		$max_value = $arrData[$i];

	if ( strlen($label[$i]) > $max_label_width )
		$max_label_width = strlen($label[$i]);

$p1->SetLegends($label);

$ttl_rkrdz = array_sum($gfData);
}


$graph->Add($p1);
$graph->Stroke("abc.jpg");
	
	echo("
			<table width='100%' border='1'>
				<tr> <td align='right'>
					<img src=abc.jpg>
				</td> </tr>
			</table>
			
			<br><br><br>
	");
	


$table_text = "<table align=center border='0'><tr><td
align='center'>&nbsp;</td></tr>
				
				<tr><td align=center></td></tr><tr><td align=center ><br><table
border=4><tr>";



for ($i = 0; $i < $max_data; $i++)
{
	if ($arrData[$i] > $max_value)
		$max_value = $arrData[$i];

	if ( strlen($label[$i]) > $max_label_width )
		$max_label_width = strlen($label[$i]);

	$table_text = $table_text . "<th> " . $label[$i] . " </th>";
	$ttl_rkrdz = array_sum($gfData);

}
$table_text = $table_text . "</tr>";
$table_text = $table_text . "<tr>";


for ($i = 0; $i < $max_data; $i++)
{

	$table_text = $table_text . "<td style= \"font-family: $font\" >" .
$gfData[$i] . "</td>";
	
	
}
$table_text = $table_text . "</tr>
		</table></td></tr>
		<tr>
			<td style= \"font-family: $font\"> </td> 
		</tr>
				<tr><td>&nbsp;</td></tr>
				
		<tr> <td>
		<table border='4' align=center> 
		<tr>
			<th width='50%' valign='center' style= \"font-family: $font\">
Total Records&nbsp; </th>
			<td width='50%' valign='center' style= \"font-family: $font\">
$ttl_rkrdz </td> 
		</tr>
		</table>
		</td>
		</tr>
		<tr><td>&nbsp;</td></tr>
		<tr><td>&nbsp;</td></tr>
		<tr><td>&nbsp;</td></tr>				
		";
		
echo($table_text);

?>


=============================================================


will someone plz jerk me out of this ..... ?????

thnx a million 

toby

________________________________________________________________________
Want to chat instantly with your online friends?  Get the FREE Yahoo!
Messenger http://uk.messenger.yahoo.com/

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux