public/wordpress/wp-content/plugins/front-end-only-users/Functions/EWD_FEUP_Widgets.php
/**
	 * Outputs the options form on admin
	 *
	 * @param array $instance The widget options
	 */
Outputs the options form on admin
@param array $instance The widget options
Outputs the options form on admin @param array $instance The widget options
public function form( $instance ) {
		global $wpdb;
		global $ewd_feup_fields_table_name;
		$Fields = $wpdb->get_results("SELECT Field_Name FROM $ewd_feup_fields_table_name");
		$field_name = ! empty( $instance['field_name'] ) ? $instance['field_name'] : __( 'Username', 'EWD_FEUP' );
		$plain_text = ! empty( $instance['plain_text'] ) ? $instance['plain_text'] : __( 'Yes', 'EWD_FEUP' );
		$before_text = ! empty( $instance['before_text'] ) ? $instance['before_text'] : __( '', 'EWD_FEUP' );
		$after_text = ! empty( $instance['after_text'] ) ? $instance['after_text'] : __( '', 'EWD_FEUP' );
		?>
		<p>
		<label for="<?php echo $this->get_field_id( 'field_name' ); ?>"><?php _e( 'Field to Display:', 'EWD_FEUP' ); ?></label> 
		<select class="widefat" id="<?php echo $this->get_field_id( 'field_name' ); ?>" name="<?php echo $this->get_field_name( 'field_name' ); ?>">
			<option value='Account_Expiry' <?php if ($instance['field_name'] == "Account_Expiry") {echo "selected=selected";} ?> >Account Expiry</option>
			<?php 
				foreach ($Fields as $Field) {
					echo "<option value='" . $Field->Field_Name ."' ";
					if ($Field->Field_Name == $instance['field_name']) {echo "selected=selected";}
					echo ">" . $Field->Field_Name . "</option>";
				} 
			?>
		</select>
		</p>
		<p>
		<label for="<?php echo $this->get_field_id( 'plain_text' ); ?>"><?php _e( 'Plain Text:', 'EWD_FEUP' ); ?></label> 
		<select class="widefat" id="<?php echo $this->get_field_id( 'plain_text' ); ?>" name="<?php echo $this->get_field_name( 'plain_text' ); ?>">
			<option value='Yes' <?php if ($instance['plain_text'] == "Yes") {echo "selected=selected";} ?> >Yes</option>
			<option value='No' <?php if ($instance['plain_text'] == "No") {echo "selected=selected";} ?> >No</option>
		</select>
		</p>
		<p>
		<label for="<?php echo $this->get_field_id( 'before_text' ); ?>"><?php _e( 'Before Text:', 'EWD_FEUP' ); ?></label> 
		<input class="widefat" id="<?php echo $this->get_field_id( 'before_text' ); ?>" name="<?php echo $this->get_field_name( 'before_text' ); ?>" type="text" value="<?php echo esc_attr( $before_text ); ?>">
		</p>
		<p>
		<label for="<?php echo $this->get_field_id( 'after_text' ); ?>"><?php _e( 'After Text:', 'EWD_FEUP' ); ?></label> 
		<input class="widefat" id="<?php echo $this->get_field_id( 'after_text' ); ?>" name="<?php echo $this->get_field_name( 'after_text' ); ?>" type="text" value="<?php echo esc_attr( $after_text ); ?>">
		</p>
		<?php 
	}
public function form ( $ instance ) { global $ wpdb ; global $ ewd_feup_fields_table_name ; $ Fields = $ wpdb -> get_results ( " SELECT Field_Name FROM  $ ewd_feup_fields_table_name " ) ; $ field_name = ! empty ( $ instance [ 'field_name' ] ) ? $ instance [ 'field_name' ] : __ ( 'Username' , 'EWD_FEUP' ) ; $ plain_text = ! empty ( $ instance [ 'plain_text' ] ) ? $ instance [ 'plain_text' ] : __ ( 'Yes' , 'EWD_FEUP' ) ; $ before_text = ! empty ( $ instance [ 'before_text' ] ) ? $ instance [ 'before_text' ] : __ ( '' , 'EWD_FEUP' ) ; $ after_text = ! empty ( $ instance [ 'after_text' ] ) ? $ instance [ 'after_text' ] : __ ( '' , 'EWD_FEUP' ) ; ?> <p>
		<label for=" <?php echo $ this -> get_field_id ( 'field_name' ) ; ?> "> <?php _e ( 'Field to Display:' , 'EWD_FEUP' ) ; ?> </label> 
		<select class="widefat" id=" <?php echo $ this -> get_field_id ( 'field_name' ) ; ?> " name=" <?php echo $ this -> get_field_name ( 'field_name' ) ; ?> ">
			<option value='Account_Expiry'  <?php if ( $ instance [ 'field_name' ] == " Account_Expiry " ) { echo " selected=selected " ; } ?> >Account Expiry</option>
			 <?php foreach ( $ Fields as $ Field ) { echo " <option value=' " . $ Field -> Field_Name . " '  " ; if ( $ Field -> Field_Name == $ instance [ 'field_name' ] ) { echo " selected=selected " ; } echo " > " . $ Field -> Field_Name . " </option> " ; } ?> </select>
		</p>
		<p>
		<label for=" <?php echo $ this -> get_field_id ( 'plain_text' ) ; ?> "> <?php _e ( 'Plain Text:' , 'EWD_FEUP' ) ; ?> </label> 
		<select class="widefat" id=" <?php echo $ this -> get_field_id ( 'plain_text' ) ; ?> " name=" <?php echo $ this -> get_field_name ( 'plain_text' ) ; ?> ">
			<option value='Yes'  <?php if ( $ instance [ 'plain_text' ] == " Yes " ) { echo " selected=selected " ; } ?> >Yes</option>
			<option value='No'  <?php if ( $ instance [ 'plain_text' ] == " No " ) { echo " selected=selected " ; } ?> >No</option>
		</select>
		</p>
		<p>
		<label for=" <?php echo $ this -> get_field_id ( 'before_text' ) ; ?> "> <?php _e ( 'Before Text:' , 'EWD_FEUP' ) ; ?> </label> 
		<input class="widefat" id=" <?php echo $ this -> get_field_id ( 'before_text' ) ; ?> " name=" <?php echo $ this -> get_field_name ( 'before_text' ) ; ?> " type="text" value=" <?php echo esc_attr ( $ before_text ) ; ?> ">
		</p>
		<p>
		<label for=" <?php echo $ this -> get_field_id ( 'after_text' ) ; ?> "> <?php _e ( 'After Text:' , 'EWD_FEUP' ) ; ?> </label> 
		<input class="widefat" id=" <?php echo $ this -> get_field_id ( 'after_text' ) ; ?> " name=" <?php echo $ this -> get_field_name ( 'after_text' ) ; ?> " type="text" value=" <?php echo esc_attr ( $ after_text ) ; ?> ">
		</p>
		 <?php }
Outputs the options form on admin
 @param array $instance The widget options
Outputs the options form on admin @param array $instance The widget options