Jump to content
We've recently updated our Privacy Statement, available here ×

Datepicker and get the Date Variable. Help


alevi12

Recommended Posts

Code 1:

<?php
$path2shared = "../../00_Shared/";
include_once($path2shared."common_includes.php");
include_once($path2shared."/jasper/jasperserver/JasperReportPDF.php");

$Start_Datum  = $_GET['Start_Datum'];                                              //  NULL
$Ende_Datum         = $_GET['Ende_Datum'];

If (empty($Start_Datum)){
$Start_Datum = new DateTime("01.01.1990") ;
}

If (empty($Ende_Datum)){
$Ende_Datum = new DateTime("31.12.2030");
}

if (empty($LOCALE)){
 $LOCALE = JasperReportLocales::REPORT_LOCALE_DEFAULT;
}

$report_params = array( 'Start_Datum'=>sprintf('%s',$Start_Datum->format("U")*1000), 
                                         'Ende_Datum'=>sprintf('%s',$Ende_Datum->format("U")*1000),

 

Code 2:

class ReportSelectorWriter
{
 public static function writeHTML($selector,$locale_selector=null){
  $log = $selector->getLogger();
  
  $form_name = "form_".$selector->getName();
  
  jquery_add_datepicker($form_name."_datepicker_start");
  jquery_add_datepicker($form_name."_datepicker_end");

echo("      Start  <input name="".$Start_Datum."" id="".$form_name."_datepicker_start" type="text" size="10" maxlength="10" onChange="suchzeitraum_check(document".$form_name."_datepicker_start,document".$form_name."_datepicker_end)">n");

 echo("Ende  <input name="Ende_Datum" id="".$form_name."_datepicker_end" type="text" size="10" maxlength="10" onChange="suchzeitraum_check(document".$form_name."_datepicker_start,document".$form_name."_datepicker_end);">n");

 


Now I want that when the date in the field is empty, then he should accept the date which I had previously already defined in Code 1.
When I click on the button to create a report and in this report, the respective date will then be created which is in the field of DatePicker and when is empty, it should take the date that I've already defined.

The variable $Start_Datum and $Ende_Datum were created in iReport.

For advice and help, I would be very grateful. Thank you 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...