0 Replies Latest reply on Jun 9, 2008 11:10 AM by chifo

    Problem with flex datchooser and php

      Hello Everyone.
      Could anyone help me? I have a problem with datechooser and php app, I'm trying to select a range of date in flex and send that range of date to a php page and create a select clause into de php page with range of dates. but the flex show me an error. This is the error. 1119: Access of possibly undefined property text through a reference with static type mx.controls:DateChooser.
      and this is the flex code:

      // Event handler function to write the selected
      // date to the Label control.
      private function displayDate(date:Date):void {
      if (date == null)
      selection.text = "Date selected: ";
      selection.text = "Date selected: " + date.getFullYear().toString() +
      '/' + (date.getMonth()+1).toString() + '/' + date.getDate();
      <mx:DateFormatter id="df"/>
      <mx:HTTPService id="userRequest" url="https://../../.../phpxml.php" useProxy="false" method="POST">
      <mx:request xmlns="">
      <mx:Form x="22" y="10" width="493" height="356">
      <mx:Label text="Email Address"/>
      <mx:TextInput id="emailaddress"/>
      <mx:Button label="Submit" click="userRequest.send()"/>
      <mx:HBox horizontalGap="25">
      <mx:Label text="Fecha inicial de busqueda"/>
      <mx:DateChooser id="dateChooser1" yearNavigationEnabled="true"
      <mx:Label id="selection" color="blue" text="Date selected:{df.format(dateChooser1.selectedDate)}"/>

      <mx:Label text="Fecha final de busqueda"/>
      <mx:DateChooser id="dateChooser2" yearNavigationEnabled="true"
      <mx:Label id="selection1" color="blue" text="Date selected: {df.format(dateChooser2.selectedDate)}"/>

      <mx:DataGrid id="dgUserRequest" x="521" y="10" dataProvider="{userRequest.lastResult.asistencia.user}" width="493" height="356">
      <mx:DataGridColumn headerText="hora" width="100" dataField="hora"/>
      <mx:DataGridColumn headerText="fecha" dataField="fecha"/>

      and the php code is follow:

      mysql_select_db( DATABASE_NAME );

      // Quote variable to make safe
      function quote_smart($value)
      // Stripslashes
      if (get_magic_quotes_gpc()) {
      $value = stripslashes($value);
      // Quote if not integer
      if (!is_numeric($value)) {
      $value = "'" . mysql_real_escape_string($value) . "'";

      $Query = ("SELECT asistencia.hora, asistencia.fecha, asistencia.i_o, asistencia.llegada
      FROM asistencia, personal WHERE
      personal.usuario_id = asistencia.usuario_id AND
      personal.email = '$_POST[emailaddress]' and
      asistencia.fecha between '$_POST[initialdate]' and '$_POST[endate]'");

      $Result = mysql_query( $Query );

      $Return = "<asistencia>";
      while ( $User = mysql_fetch_object( $Result ) )
      $Return .= "<user><status>".$User->i_o."</status><hora>".$User->hora."</hora><fecha>".$User->fecha." </fecha></user>";

      Thanks and advanced.