Subversion Repositories phpLibraryV2

Rev

Rev 43 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 43 Rev 45
Line 176... Line 176...
176
      function htmlSelect ( $parameters ) {
176
      function htmlSelect ( $parameters ) {
177
         
177
         
178
         //print "<pre>" . print_r( $parameters, true ) . "</pre>"; die;
178
         //print "<pre>" . print_r( $parameters, true ) . "</pre>"; die;
179
         
179
         
180
         if ( empty( $parameters['data'] ) ) {
180
         if ( empty( $parameters['data'] ) ) {
-
 
181
            // print "<pre>No data, running query\n" . $parameters['query'] . "</pre>"; die;
181
            if ( empty( $paramters['query'] ) )
182
            if ( empty( $parameters['query'] ) )
182
               return '';
183
               return '';
183
            $save = $this->useAssociativeArray;
184
            $save = $this->useAssociativeArray;
184
            $useAssociativeArray = false; // temporarily turn off associative arrays
185
            $useAssociativeArray = false; // temporarily turn off associative arrays
-
 
186
            //print "<pre>Running Query\n</pre>";
185
            $this->query( $parameters['query'] );
187
            $data = $this->doSQL( $parameters['query'] );
-
 
188
            //print "<pre>" . print_r( $data, true ) . "</pre>"; die;
186
            if ( $this->rowsAffected ) { // we returned at least one row
189
            if ( $data['rowsAffected'] ) { // we returned at least one row
-
 
190
               $data = $data['returnData'];
187
               foreach ($this->returnData as $rowNumber => $value ) {
191
               foreach ($data as $rowNumber => $value ) {
188
                  $parameters['data'][$value[0]] = $value[1];
192
                  $parameters['data'][$value[0]] = $value[1];
189
               }
193
               }
190
            }
194
            }
191
         }
195
         }
-
 
196
         //return "<pre>Data is \n" . print_r( $parameters['data'], true ) . "</pre>";
192
         $selectedKey = isset( $parameters['selected'] ) ? $parameters['selected'] : '';
197
         $selectedKey = isset( $parameters['selected'] ) ? $parameters['selected'] : '';
193
         $options = array();
198
         $options = array();
194
         if ( isset( $parameters['nullok'] ) ) {
199
         if ( isset( $parameters['nullok'] ) ) {
195
            $options[] = '<option value="-1">---</option>';
200
            $options[] = '<option value="-1">---</option>';
196
         }
201
         }