Jump to content

This topic is 2026 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Under the hood, FileMaker always wants mm/dd/yyyy


It may display it differently but...


If the web form input is in dd/mm/yyyy (use a JavaScript date picker for this bit) then you can convert for input:


$date_input = $_POST(date);

$date_array = explode ("/"; $date_input);

$date_toFM = $date_array[1]."/".$date_array[0]."/".$date_array[2];


And input the $date_toFM variable to the database


I think that should work - been a while since I wrote code...

Link to post
Share on other sites

So I'll assume that you are doing a search on a date, from a search form...


The above would need to be in the php section at the top, and before the actual search query, with the search query using the $date_toFM variable for the date part of it...


If you paste your code for the search results page, I should be able to check it fairly quickly

Link to post
Share on other sites

Cool... try:


//Setup date to be in US format from AU format
$date_input = $_REQUEST['Date_Start'];
$date_array = explode ("/"; $date_input);
$date_toFM = $date_array[1]."/".$date_array[0]."/".$date_array[2];

$search_bookings_results_find = $Marthakal->newFindCommand('Booking');
//Note Date_start is using the $date_toFM valye from above
$search_bookings_results_findCriterions = array('Date_Start'=>$date_toFM,'Event_Resource'=>$_REQUEST['Event_Resource'],'triprecordnumber'=>$_REQUEST['triprecordnumber'],'payment_receipt no'=>$_REQUEST['payment_receipt_no'],'Status_Option'=>'=='.fmsEscape('Set As Paid'),'Pilot'=>$_REQUEST['Pilot'],);
foreach($search_bookings_results_findCriterions as $key=>$value) {
$search_bookings_results_result = $search_bookings_results_find->execute();
if(FileMaker::isError($search_bookings_results_result)) fmsTrapError($search_bookings_results_result,"searcherror.php");
$search_bookings_results_row = current($search_bookings_results_result->getRecords());
$search_bookings_results__ClientBooking_portal = fmsRelatedRecord($search_bookings_results_row, 'Client_Booking');
$search_bookings_results__BookingClients_portal = fmsRelatedRecord($search_bookings_results_row, 'Booking_Clients');
$search_bookings_results__BookingManifest_portal = fmsRelatedRecord($search_bookings_results_row, 'Booking_Manifest');

// FMStudio Pro - do not remove comment, needed for DreamWeaver support ?>
Link to post
Share on other sites

This topic is 2026 days old. Please don't post here. Open a new topic instead.

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
  • Similar Content

    • By ellpe

      I´m a newbie working with PHP and I wonder if anyone knows if it´s possible to use SuperContainer togehter with FmStudio Pro from FmWebSchool.

      If yes, I would be happy to learn how.

      I´m working with FmPro Server 10 Advanced in Windows Vista and FmPro Adv 11, in Win XP

      Regards LarsP, Sweden
    • By NYC Newbie
      I have an ecommerce site in which the inventory is also listed on another metasite (i.e. amazon, ebay, etc..). The metasite maintains its own separate inventory.
      I need to send a xml to the metasite's webservice whenever someone buys an item on my website.
      The purpose of this xml is to delete the item off the metasite immediately.

      I am using FMStudio for FX.php and Filemaker Pro 11.
      The delete xml will be generated upon payment confirmation from the buyer. It is autogenerated as a webpage.
      I also have a php page that sends a 'file_get_contents' to the webservice sucessfully - meaning it works just fine when sending an xml file that resides in the same folder.
      But I don't know how to integrate the two. The two files do not sit in the same folder so the latter is having a hard time finding the former, and any combination of "../foldername.php" doesn't seem to work.
      And i'm not even sure this is the most expedient way to do this so I'm open to any suggestions.

      Here is my autogenerated delete xml page in php. Basically it lists the ids of ordered items that reside in a portal on an FM layout called 'orders' -

      <?php require_once('Connections/invoices.php'); ?>
      <?php $ids_find = clone($invoices);
      $ids_find->layout = 'orders';
      $ids_findCriterions = array('orderID'=>$_REQUEST['orderid'],);
      foreach($ids_findCriterions as $key=>$value) {


      $ids_result = $ids_find->FMFind();

      if(is_a($ids_result,'FX_Error') || $ids_result['errorCode'] != "0") fmsTrapError($ids_result,"error.php");

      $ids_row = current($ids_result['data']);
      $ids_row_key = key($ids_result['data']);

      $ids_orderlineitem_portal_row = 0;
      $ids_orderpaypalvars_portal_row = 0;



      //FMStudioFX v1.0 - do not remove comment, needed for DreamWeaver support ?>
      header('content-type: text/xml; charset=utf-8');
      echo('<?xml version="1.0" encoding="ISO-8859-1"?>');
      echo('<inventoryUpdateRequest version="1.0">');
      echo('<action name="bookupdate">');
      $ids_orderlineitem_portal_rownum = 1;
      foreach($ids_row['order_line_item::bookID'] as $ids_orderlineitem_portal_row=>$ids_orderlineitem_portal){
      echo('<vendorBookID>'.$ids_row['order_line_item::bookID'][$ids_orderlineitem_portal_row].'</vendorBookID> </MetaSite>');
      if($ids_orderlineitem_portal_rownum == 0) break; else $ids_orderlineitem_portal_rownum++;

      The xml document appears in a URL formatted correctly. But I don't care for the buyers to see this page, not even a millisecond of it.

      Here is the redirected 'Books/websitedeleteIndex.php file -

      <?php require_once('post_xml.php');?>
      <?php $xml = file_get_contents('updateInventory.php');
      $url ='https://inventoryupdate.metasite.com';
      $port = 80;

      $response = xml_post($xml, $url, $port);

      <!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">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <title>Untitled Document</title>

      I tried <?php $xml = file_get_contents('../updateInventory.php') because it sits one directory level up. Doesn't work.
      But there's got to be an easier way to send this info, yes?
    • By Steven1337
      The left menu on my website is dynamic and it is based off a recordset from my filemaker database. My left menu is included on every page of my website and I do not want the find of the recordset to occur every time a user browses to a different page. I am looking for a way to store the results in a session so that it only has to look for them once per session. The code that creates my leftbar menu looks like this:

      <?php // FMStudio v1.0 - do not remove comment, needed for DreamWeaver support ?> <?php $categories_find = $Rackspace->newFindCommand('vehiclesearchsmall'); $categories_findCriterions = array('VehicleCategory'=>'=='.$_SESSION['make'],'VehicleId'=>$_SESSION['model'],'year'=>$_SESSION['year'],); foreach($categories_findCriterions as $key=>$value) { $categories_find->AddFindCriterion($key,$value); } fmsSetPage($categories_find,'categories',10000); $categories_find->addSortRule('SubCategory2',1,FILEMAKER_SORT_ASCEND); $categories_result = $categories_find->execute(); if(FileMaker::isError($categories_result)) {$error = 'yes';} else { fmsSetLastPage($categories_result,'categories',10000); $categories_row = current($categories_result->getRecords()); } ?> <?php $lis = array(); foreach ($categories_result->getRecords() as $cer) { $tac = $cer->getField('SubCategory2'); $lis[$tac] = (!isset($lis[$tac])) ? 1 : $lis[$tac] +1 ; } foreach ($lis as $nam => $valu) { echo '<dd class="categories" style="border-bottom:1px dotted #999;"><a href="cilist.php?VehicleCategory='. $_SESSION['make'] .'&SubCategory2=' . $nam . '&VehicleId=' .$_SESSION['model'] . '&year=' . $_SESSION['year'] . '" >' . $nam .'</a> '. '(' . $valu . ')' . '</dd>'; } ?>

      I tried storing the $categories_row in a session variable but it would only give me one result. I am stuck here any help would be greatly appreciated.
    • By midimid
      Something I'm a bit perplexed about. I have Filemaker 10 Advanced, FMStudio with Dreamweaver CS5 and apache installed locally. We are using fmgateway for hosting.

      Using the above, can I setup things so that I'm developing entirely locally without touching the online fmgateway DB, then move the DB and local php files online when I need to launch?
    • By Jerry100
      Does anyone know if FM Studio and Dreamweaver CS4 are compatible and if there is any advantage in purchasing CS4 instead of CS3?
  • Who Viewed the Topic

    5 members have viewed this topic:
    Geoffrey Gerhard  iain@filemakeru.com  Tattwam  ziyunchen  Goetch 

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.