• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 471
  • Last Modified:

custom joomla page

I am trying to create a custom joomla page that pull put the data entered in a database such as


username
date
quizname,

I am a .net programmer and have very few knboledge of php , how would I do this , this is the page that i currently have
<?php
/*
Note that this line: /F (http://www.mysite.com/CompletionForm.pdf)
determines the PDF File to be filled in. Change to point to the
PDF file on your site. txtName variable is the user's name to populate.
*/

var_dump($_SESSION);
ob_start(); 

$txtName  = $_GET['givenname'];

echo $txtName ;
//$txtName  =  $this->get('firstname');
//echo $this->session->title; 

//$txtCourseName = $GET['txtCourseName'];
//$txtCourseName = $GET['txtCompletionDate'];
header("Content-type: application/vnd.fdf");
echo <<<EOT
%FDF-1.2
1 0 obj
<<
/FDF
<< 
/Fields
[ 
<<
/T (txtName)
/V ({$txtName})
>> 
]
/F (http://appdevelsvr:8080/shquiz/media/certificate/CourseCertificate.pdf)

>> 
>>
endobj
trailer
<<
/Root 1 0 R
>>
%%EOF
EOT;
ob_flush(); 
?>

Open in new window

0
TonyReba
Asked:
TonyReba
  • 2
  • 2
1 Solution
 
Ray PaseurCommented:
How does Joomla fit into this question?  It looks more like a script to create a PDF?
0
 
TonyRebaAuthor Commented:
Well my  first goal is to be able to pull the data either by quering the mysql database on Joomla, or the classes in Joomla and display in a Joomla page,   After that I need to create a pdf form with those retreived values..

Can you please help, at least give me a starting point on where to look this values ?
0
 
Andrew DerseIT ManagerCommented:
Here's what I use to accomplish that.  (I have built extremely complex custom php pages for my company on more than 1 Joomla web application.)

1) Install Jumi.
http://extensions.joomla.org/extensions/edition/custom-code-in-content/1023

2) Create a custom php page and place it in this location:
components/com_jumi/files/<folderyoucreate>/fileyoucreate.php

3) Go to Components and select Jumi Application

4) Click on "NEW"

5) Enter a title and the path to the custom page.
See Screen shot.

6) Create new menu item, use Jumi Application and point to custom file you created.

This should do the trick.  If you have any problems, let me know.
1.PNG
0
 
Andrew DerseIT ManagerCommented:
Here's a sample page I created for a small web app...

This pulls information from the database into my custom page that I linked to on the previous post.

*The "require_once('db.php');" file is just pulling another .php file I created that creates the database connection I needed to query the database.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php
require_once('db.php');
$status = $_GET['status'];

if ($status == 'LEGAL')
{
	$status = 'LEGAL REVIEW';	
}

$query = mysql_query("SELECT * FROM jos_a_complaint where status = '$status'");
$count  = mysql_num_rows($query);
?>
<div id="upper_text" style="text-align:center">
<p>Please select which status you would like to report on:</p>
</div>
<table align="center">
<tr>
<td><div class="reporting_option"><a href="http://intranet/mapadb/index.php?option=com_jumi&view=application&fileid=5&Itemid=163&status=NEW" id="report_single">NEW</a></div></td>
<td><div class="reporting_option"><a href="http://intranet/mapadb/index.php?option=com_jumi&view=application&fileid=5&Itemid=163&status=OPEN" id="report_single">OPEN</a></div></td>
<td><div class="reporting_option"><a href="http://intranet/mapadb/index.php?option=com_jumi&view=application&fileid=5&Itemid=163&status=LEGAL" id="report_single">LEGAL REVIEW</a></div></td>
<td><div class="reporting_option"><a href="http://intranet/mapadb/index.php?option=com_jumi&view=application&fileid=5&Itemid=163&status=CLOSED" id="report_single">CLOSED</a></div></td>
</tr>
</table>
<?php 
if($count == '0')
{
	echo '<br /><br /><div style=\'text-align:center\';>We\'re sorry, but there are currently no records with that status.</div>';
}
else
{
?>
<br />
<table align="center" class="status_report" cellpadding="15px" cellspacing="0">
<tr>
	<th>File #:</th><th>Date Entered:</th><th>Last Name:</th><th>First Name</th><th>Class Code:</th>
</tr>


<?php
while($row=mysql_fetch_array($query))
{
$fileNum = $row['fileNum'];
$compDate = $row['compDate'];
$lastName = $row['lastName'];
$firstName = $row['firstName'];
$classCode = $row['classCodeID'];

$query2 = mysql_query("SELECT * FROM jos_a_classcode where id = $classCode");
while($rows = mysql_fetch_array($query2))
{
$codeDesc = $rows['codeDesc'];
}

?>

<tr style="border-top: 1px solid #ccc;">
	<td style="text-align:center"><?php print $fileNum;?></td><td style="text-align:center"><?php print $compDate;?></td><td><?php print $lastName;?></td><td><?php print $firstName;?></td><td><?php print $classCode . " - " . $codeDesc;?></td>
</tr>

<?php
}
?>

</table>
<?php } ?>
</body>
</html>

Open in new window

0
 
TonyRebaAuthor Commented:
ty
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now