Jump to content

Recommended Posts

Hi

 

I'm trying to get the layout like i want but it's not easy

 

I have this file

<?PHP
require_once("./include/membersite_config.php");
if(!$fgmembersite->CheckLogin())
{
    $fgmembersite->RedirectToURL("login.php");
    exit;
}
if(isset($_POST['submitted']))
{
$fgmembersite->PesquisarPorDatas();
}

?>
               
			<div id='fg_membersite_content'>
			<div class="CSSTableGenerator" >
				//I want the result here
			</div>
			<br>
			

I want the result of this $fgmembersite->PesquisarPorDatas(); in "//I want the result here" the r of my code, when the user use the "Pesquisar" button this fucntion is called but the result comes out of my css

 

any help please??

Edited by alphasil
Link to comment
https://forums.phpfreaks.com/topic/292888-call-function/
Share on other sites

a function/method will generally return data, that you can then assign to a variable or directly loop over. it may however make the data available as a class property. in either case, it would take looking at the documentation and/or code for the PesquisarPorDatas() method in order to find out what where, what, and what format the data is in.

Link to comment
https://forums.phpfreaks.com/topic/292888-call-function/#findComment-1498496
Share on other sites

Thanks

 

Resolved, the submit was wrong.

 

After submit i want to keep 2 variable (dataInicio) and (dataFim) to pass to another query to make the pdf.

<?php
				if(isset($_POST['submitted']))
				{
				  $fgmembersite->PesquisarPorDatas();
				  $dataInicio = $_POST["dataInicio"];
				  $dataFim = $_POST["dataFim"];
				}
			

then in the url 

<p><a href='pdfAct.php?dataInicio=$dataInicio&dataFim=$dataFim'>Imprimir estas atividades</a></p> 

but the result is blank

http://xxxxxxxxxxx/atividades/pdfAct.php?dataInicio=$dataInicio&dataFim=$dataFim 

So i have no values....whats wrong??

Thanks

Link to comment
https://forums.phpfreaks.com/topic/292888-call-function/#findComment-1498499
Share on other sites

Thanks again...i'm learning a lot from you guys.

 

Last question, it workings, i can see the dates in the url but the pages comes blank

 

this is my query

$dataInicio=$_GET['dataInicio'];
$dataFim=$_GET['dataFim'];
echo $dataInicio;
echo $dataFim;
$pdf->connect('localhost', 'xxxxxx', 'xxxxxx', 'xxxxxx');
$pdf->mysql_report("SELECT  `atividade` ,  `data` ,  `hora` ,  `local` ,  `inter`  FROM  `pae_atividades` WHERE(`data` BETWEEN '$dataInicio' AND '$dataFim'") ORDER BY `data` ASC LIMIT 0 , 30");
?>

and the url is

http://ebspma.edu.pt/atividades/pdfAct.php?dataInicio=2014-12-05&dataFim=2014-12-19

So it must be the query...any help?

Edited by alphasil
Link to comment
https://forums.phpfreaks.com/topic/292888-call-function/#findComment-1498509
Share on other sites

See in your query above how most of the text is in green and some is in black? That's because you end your query by closing the double quote right after

AND '$dataFim'"  <-- premature double quote.

 

You have 3 double quotes in your query, so there is an extra one or one is not closed. They should always be in pairs. Remove the one after $dataFim.

Link to comment
https://forums.phpfreaks.com/topic/292888-call-function/#findComment-1498511
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.