Jump to content

[SOLVED] Profile Field Custom Field Problem


OmerAslan

Recommended Posts

12 hours ago, servetas said:

Which phpVMS version are you using? Can you share any screenshots? Do you refer to the user part or the admin part of your phpVMS system?

Hi George,

I have 5.5.2 version. Screenshot like empty space. No error. From user part and admin part the same.

Link to comment
Share on other sites

1 minute ago, servetas said:

Can you paste here or send me in any way the following files:

admin/templates/pilot_details.php -and-

core/templates/profile_edit.php or lib/skins/your_skin/profile_edit.php (if exists)

admin/templates/pilot_details.php

<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<form id="dialogform" action="<?php echo adminaction('/pilotadmin/viewpilots');?>" method="post">
<table id="tabledlist" class="tablesorter" style="float: left">
<thead>
	<tr>
		<th colspan="2">Edit Pilot Details</th>	
	</tr>
</thead>
<tbody>

<tr>
	<td>Avatar</td>
	<td>
		<?php
		$pilotcode = PilotData::GetPilotCode($pilotinfo->code, $pilotinfo->pilotid);

		if(!file_exists(SITE_ROOT.AVATAR_PATH.'/'.$pilotcode.'.png')) {
			echo 'None selected';
		} else {
		?>
			<img src="<?php	echo SITE_URL.AVATAR_PATH.'/'.$pilotcode.'.png';?>" />
		<?php
		}
		?>
	</td>

</tr>

<tr>
	<td>Pilot ID</td>
	<td><?php echo $pilotcode ?></td>
</tr>

<tr>
	<td>First Name</td>
	<td><input type="text" name="firstname" value="<?php echo $pilotinfo->firstname;?>" /></td>
</tr>

<tr>
	<td>Last Name</td>
	<td><input type="text" name="lastname" value="<?php echo $pilotinfo->lastname;?>" /></td>
</tr>
<tr>
	<td>Email Address</td>
	<td><input type="text" name="email" value="<?php echo $pilotinfo->email;?>" /></td>
</tr>
<tr>
	<td>Airline</td>
	<td>
		<select name="code">
		<?php
		$allairlines = OperationsData::GetAllAirlines();
		foreach($allairlines as $airline) {
			if($pilotinfo->code == $airline->code)
				$sel =  ' selected';
			else
				$sel = '';
				
			echo '<option value="'.$airline->code.'" '
						.$sel.'>'.$airline->name.'</option>';
		}
		?>	
		</select>
	</td>
</tr>
<tr>
	<td>Location</td>
	<td><select name="location">
			<?php
			foreach($countries as $countryCode=>$countryName) {
				if($pilotinfo->location == $countryCode)
					$sel = 'selected="selected"';
				else	
					$sel = '';
				
				echo '<option value="'.$countryCode.'" '.$sel.'>'.$countryName.'</option>';
			}
					?>
		</select>
	</td>
</tr>
<tr>
	<td>Hub</td>
	<td>
		<select name="hub">
		<?php
		$allhubs = OperationsData::GetAllHubs();
		foreach($allhubs as $hub) {
			if($pilotinfo->hub == $hub->icao)
				$sel = ' selected';
			else
				$sel = '';
			
			echo '<option value="'.$hub->icao.'" '.$sel.'>'.$hub->icao.' - ' . $hub->name .'</option>';
		}
		?>	
		</select>
	</td>
</tr>
<tr>
	<td>Current Rank</td>
	<td>
	<?php
	if(Config::Get('RANKS_AUTOCALCULATE') == false) {
		$allranks = RanksData::GetAllRanks();
		echo '<select name="rank">';
		
		foreach($allranks as $rank) {
            $selected = ($pilotinfo->rank == $rank->rank) ? "selected=\"selected\"": '';
			echo "<option value=\"{$rank->rankid}\" {$selected}>{$rank->rank}</option>";
		}
		echo '</select>';
	} else {
		echo $pilotinfo->rank;
	}
	?></td>
</tr>
<tr>
	<td>Date Joined</td>
	<td><?php echo date(DATE_FORMAT, strtotime($pilotinfo->joindate));?></td>
</tr>
<tr>
	<td>Last Login</td>
	<td><?php echo date(DATE_FORMAT, strtotime($pilotinfo->lastlogin));?></td>
</tr>
<tr>
	<td>Last Flight</td>
	<td><?php echo date(DATE_FORMAT, strtotime($pilotinfo->lastpirep));?></td>
</tr>
<tr>
	<td>Total Flights</td>
	<td><input type="text" name="totalflights" value="<?php echo $pilotinfo->totalflights;?>" /></td>
</tr>
<tr>
	<td>Total Hours</td>
	<td><?php echo $pilotinfo->totalhours;?>
		<input type="hidden" name="totalhours" value="<?php echo $pilotinfo->totalhours;?>" />
	</td>
</tr>
<tr>
	<td>Transfer Hours</td>
	<td><input type="text" name="transferhours" value="<?php echo $pilotinfo->transferhours;?>" /></td>
</tr>
<tr>
	<td>Total Pay</td>
	<td><input type="text" name="totalpay" value="<?php echo $pilotinfo->totalpay;?>" /></td>
</tr>
<tr>
	<td>Pay Adjustment</td>
	<td><input type="text" name="payadjust" value="<?php echo $pilotinfo->payadjust;?>" /></td>
</tr>
<tr>
	<td>Pilot active?</td>
	<td><select name="retired">
        <?php 
    
        $pilotStatuses = Config::get('PILOT_STATUS_TYPES');
        foreach($pilotStatuses as $id => $info) {
            if($pilotinfo->retired == $id) {
                $active = 'selected';
            } else {
                $active = '';
            }
            
            echo '<option value="'.$id.'" '.$active.'>'.$info['name'].'</option>';
        }
        
		?>
		</select>
        
        <input type="checkbox" name="resend_email" value="true" />Check to resend the welcome email
	
	</td>
</tr>
<tr>
	<td>Admin Comment</td>
	<td><textarea style="width: 100%; height: 70px;" name="comment"><?php echo $pilotinfo->comment;?></textarea>
</tr>
<tr>
<?php
if($customfields) {
	foreach($customfields as $field) {
?>
	<tr>
		<td><?php echo $field->title;?></td>
		<td>
		<?php
		if($field->type == 'dropdown') {
			
			echo "<select name=\"{$field->fieldname}\">";
			$values = explode(',', $field->fieldvalues);
		
			if(is_array($values)) {						
				foreach($values as $val) {
					$sel = ($field->value === $val) ? 'sel="selected"' : '';
					
					$val = trim($val);
					echo "<option value=\"{$val}\" {$sel} >{$val}</option>";
				}
			}
			
			echo '</select>';
		} elseif($field->type == 'textarea') {
			echo '<textarea name="'.$field->fieldname.'" style="width: 400px; height: 100px" class="customfield_textarea">'.$field->value.'</textarea>';
		} else {
			echo '<input type="text" name="'.$field->fieldname.'" value="'.$field->value.'" />';
		}
		?>
		</td>
	</tr>
<?php
	}
}
?>	
	<tr>
		<td colspan="2">
			<input type="hidden" name="pilotid" value="<?php echo $pilotinfo->pilotid;?>" />
			<input type="hidden" name="action" value="saveprofile" />
			<input type="submit" name="submit" value="Save Changes" />
			<div id="results"></div>
		</td>
	</tr>
</tbody>
</table>
</form>

core/templates/profile_edit.php

<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
<h3>Edit Profile</h3>
<form action="<?php echo url('/profile');?>" method="post" enctype="multipart/form-data">
<dl>
	<dt>Name</dt>
	<dd><?php echo $pilot->firstname . ' ' . $pilot->lastname;?></dd>
	
	<dt>Airline</dt>
	<dd><?php echo $pilot->code?>
		<p>To request a change, contact your admin</p>
	</dd>
	
	<dt>Email Address</dt>
	<dd><input type="text" name="email" value="<?php echo $pilot->email;?>" />
		<?php
			if(isset($email_error) && $email_error == true)
				echo '<p class="error">Please enter your email address</p>';
		?>
	</dd>
	
	<dt>Location</dt>
	<dd><select name="location">
		<?php
		foreach($countries as $countryCode=>$countryName)
		{
			if($pilot->location == $countryCode)
				$sel = 'selected="selected"';
			else	
				$sel = '';
			
			echo '<option value="'.$countryCode.'" '.$sel.'>'.$countryName.'</option>';
		}
		?>
		</select>
		<?php
			if(isset($location_error) &&  $location_error == true)
				echo '<p class="error">Please enter your location</p>';
		?>
	</dd>
	
	<dt>Signature Background</dt>
	<dd><select name="bgimage">
		<?php
		foreach($bgimages as $image)
		{
			if($pilot->bgimage == $image)
				$sel = 'selected="selected"';
			else	
				$sel = '';
			
			echo '<option value="'.$image.'" '.$sel.'>'.$image.'</option>';
		}
		?>
		</select>
	</dd>
	
	<?php
	if($customfields) {
		foreach($customfields as $field) {
			echo '<dt>'.$field->title.'</dt>
				  <dd>';
			
			if($field->type == 'dropdown') {
				$field_values = SettingsData::GetField($field->fieldid);				
				$values = explode(',', $field_values->value);
				
				
				echo "<select name=\"{$field->fieldname}\">";
			
				if(is_array($values)) {		
				    
					foreach($values as $val) {
						$val = trim($val);
						
						if($val == $field->value)
							$sel = " selected ";
						else
							$sel = '';
						
						echo "<option value=\"{$val}\" {$sel}>{$val}</option>";
					}
				}
				
				echo '</select>';
			} elseif($field->type == 'textarea') {
				echo '<textarea name="'.$field->fieldname.'" class="customfield_textarea">'.$field->value.'</textarea>';
			} else {
				echo '<input type="text" name="'.$field->fieldname.'" value="'.$field->value.'" />';
			}
			
			echo '</dd>';
		}
	}
	?>
	
	<dt>Avatar:</dt>
	<dd><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo Config::Get('AVATAR_FILE_SIZE');?>" />
		<input type="file" name="avatar" size="40"> 
		<p>Your image will be resized to <?php echo Config::Get('AVATAR_MAX_HEIGHT').'x'.Config::Get('AVATAR_MAX_WIDTH');?>px</p>
	</dd>
	<dt>Current Avatar:</dt>
	<dd><?php	
			if(!file_exists(SITE_ROOT.AVATAR_PATH.'/'.$pilotcode.'.png')) {
				echo 'None selected';
			} else {
		?>
			<img src="<?php	echo SITE_URL.AVATAR_PATH.'/'.$pilotcode.'.png';?>" /></dd>
		<?php
		}
		?>
	<dt></dt>
	<dd><input type="hidden" name="action" value="saveprofile" />
		<input type="submit" name="submit" value="Save Changes" /></dd>
</dl>
</form>

lib/skins/your_skin/profile_edit.php

<?php if(!defined('IN_PHPVMS') && IN_PHPVMS !== true) { die(); } ?>
              <div class="wraper container-fluid">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="bg-picture text-center" style="background-image:url(https://www.assertivestyle.com/toplama/img/Crew.jpg)">
                                <div class="bg-picture-overlay"></div>
                                <div class="profile-info-name">
                                    <img src="https://www.assertivestyle.com/toplama/img/pilot-512.png" class="thumb-lg img-circle img-thumbnail" alt="profile-image">
                                    <h3 class="text-white"><?php echo Auth::$userinfo->firstname; ?> <?php echo Auth::$userinfo->lastname; ?></h3>
                                </div>
                            </div>
                            <!--/ meta -->
                        </div>
                    </div>
                    <div class="row user-tabs">
                        <div class="col-lg-9 col-md-9 ">
                            <ul class="nav nav-tabs tabs">
                            <li class="active tab">
                                <a href="#home-2" data-toggle="tab" aria-expanded="false" class="active"> 
                                    <span class="visible-xs"><i class="fa fa-home"></i></span> 
                                    <span class="hidden-xs">About Me</span> 
                                </a> 
                            </li> 
                            <li class="tab" > 
                                <a href="#settings-2" data-toggle="tab" aria-expanded="false"> 
                                    <span class="visible-xs"><i class="fa fa-cog"></i></span> 
                                    <span class="hidden-xs">Edit Info</span> 
                                </a> 
                            </li> 
                            <li class="tab" > 
                                <a href="#home-1" data-toggle="tab" aria-expanded="false"> 
                                    <span class="visible-xs"><i class="fa fa-cog"></i></span> 
                                    <span class="hidden-xs">Change Password</span> 
                                </a> 
                          <!-----  </li> 
                                <li class="tab" > 
                                <a href="#home-3" data-toggle="tab" aria-expanded="false"> 
                                    <span class="visible-xs"><i class="fa fa-cog"></i></span> 
                                    <span class="hidden-xs">View Your Stats</span> 
                                </a> 
                            </li>------------------> 
                        <div class="indicator"></div></ul> 
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-lg-12"> 
                        
                        <div class="tab-content profile-tab-content"> 
                            <div class="tab-pane active" id="home-2"> 
                                <div class="row">
                                    <div class="col-md-4">
                                        <!-- Personal-Information -->
                                        <div class="panel panel-default panel-fill">
                                            <div class="panel-heading"> 
                                                <h3 class="panel-title">Personal Information</h3> 
                                            </div> 
                                            <div class="panel-body"> 
                                                <div class="about-info-p">
                                                    <strong>Full Name</strong>
                                                    <br/>
                                                    <p class="text-muted"><?php echo Auth::$userinfo->firstname; ?> <?php echo Auth::$userinfo->lastname; ?></p>
                                                </div>
                                                <div class="about-info-p">
                                                    <strong>Rank</strong>
                                                    <br/>
                                                    <p class="text-muted"><?php echo Auth::$userinfo->rank; ?></p>
                                                </div>
                                                <div class="about-info-p m-b-0">
                                                    <strong>Pilot Number</strong>
                                                    <br/>
                                                    <p class="text-muted"><?php echo Auth::$userinfo->pilotid; ?></p>
                                                </div>
                                                <div class="about-info-p">
                                                    <strong>Email</strong>
                                                    <br/>
                                                    <p class="text-muted"><?php echo Auth::$userinfo->email; ?></p>
                                                </div>
                                                <div class="about-info-p m-b-0">
                                                    <strong>Location</strong>
                                                    <br/>
                                                    <p class="text-muted"><?php echo Auth::$userinfo->location; ?></p>
                                                </div>
                                            </div> 
                                        </div>
                                        <!-- Personal-Information -->

                                        <!-- Languages -->
                                      
                                        <!-- Languages -->

                                    </div>


                                    <div class="col-md-8">
                                        <!-- Personal-Information -->
                                      
                                        <!-- Personal-Information -->

                                        <div class="panel panel-default panel-fill">
                                            <div class="panel-heading"> 
                                                <h3 class="panel-title">Quick Stats</h3> 
                                            </div> 
                                            <div class="panel-body"> 
                                               <!-- Total Hours -->
              <p>Total Hours: </p><?php echo Auth::$userinfo->totalhours;?><br>
                <p>Total Flights: </p><?php echo Auth::$userinfo->totalflights?><br>
        <!-- Total Transfer Hours -->
                <p>Transfer Hours: </p><?php echo $userinfo->transferhours?><br>
        <!-- Hours Until Rank Promotion -->
                <p>Hours Until Next Rank: </p><?php echo ($nextrank->minhours - $pilot_hours)?><br>
        <!-- Next Available Rank -->
                <p>Rank: </p><?php echo $userinfo->rank?><br>
        <!-- Total Virtual Money -->
                <p>Virtual Cash: </p><?php echo FinanceData::FormatMoney($userinfo->totalpay) ?><br>

</table>
                                            </div> 
                                        </div>

                                    </div>

                                </div>
                            </div> 


                            <div class="tab-pane" id="settings-2">
                                <!-- Personal-Information -->
                                <div class="panel panel-default panel-fill">
                                    <div class="panel-heading"> 
                                        <h3 class="panel-title">Edit Profile</h3> 
                                    </div> 
                                    <div class="panel-body"> 
                                        <h3>Edit Profile</h3>
<form action="http://www.crew.aalvirtual.com/index.php/profile" method="post" enctype="multipart/form-data">
<dl>
    <div class="row">
        <div class="col-md-6">
	<dt>Name</dt>
    <div class="form-group">
	<dd><?php echo $pilot->firstname . ' ' . $pilot->lastname;?></dd>
    </div>
	<dt>Airline</dt>
    <div class="form-group">
	<dd><?php echo $pilot->code?>
		<p>To request a change, contact your admin</p>
	</dd>
    </div>
	<dt>Email Address</dt>
    <div class="form-group">
	<dd><input type="text" name="email" value="<?php echo $pilot->email;?>" />
		<?php
			if(isset($email_error) && $email_error == true)
				echo '<p class="error">Please enter your email address</p>';
		?>
	</dd>
    </div>
	<dt>Location</dt>
    <div class="form-group">
	<dd><select name="location">
		<?php
		foreach($countries as $countryCode=>$countryName)
		{
			if($pilot->location == $countryCode)
				$sel = 'selected="selected"';
			else	
				$sel = '';
			
			echo '<option value="'.$countryCode.'" '.$sel.'>'.$countryName.'</option>';
		}
		?>
		</select>
		<?php
			if(isset($location_error) &&  $location_error == true)
				echo '<p class="error">Please enter your location</p>';
		?>
	</dd>
    </div>
	<dt>Signature Background</dt>
    <div class="form-group">
	<dd><select name="bgimage">
		<?php
		foreach($bgimages as $image)
		{
			if($pilot->bgimage == $image)
				$sel = 'selected="selected"';
			else	
				$sel = '';
			
			echo '<option value="'.$image.'" '.$sel.'>'.$image.'</option>';
		}
		?>
		</select>
	</dd>
    </div>
        </div>
        <div class="col-md-6">
    <div class="form-group">
	<?php
	if($customfields) {
		foreach($customfields as $field) {
			echo '<dt>'.$field->title.'</dt>
				  <dd>';
			
			if($field->type == 'dropdown') {
				$field_values = SettingsData::GetField($field->fieldid);				
				$values = explode(',', $field_values->value);
				
				
				echo "<select name=\"{$field->fieldname}\">";
			
				if(is_array($values)) {		
				    
					foreach($values as $val) {
						$val = trim($val);
						
						if($val == $field->value)
							$sel = " selected ";
						else
							$sel = '';
						
						echo "<option value=\"{$val}\" {$sel}>{$val}</option>";
					}
				}
				
				echo '</select>';
			} elseif($field->type == 'textarea') {
				echo '<textarea class="customfield_textarea"></textarea>';
			} else {
				echo '<input type="text" name="'.$field->fieldname.'" value="'.$field->value.'" />';
			}
			
			echo '</dd>';
		}
	}
	?>
    </div>
	<dt>Avatar:</dt>
    <div class="form-group">
	<dd><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo Config::Get('AVATAR_FILE_SIZE');?>" />
		<input type="file" name="avatar" size="40"> 
		<p>Your image will be resized to <?php echo Config::Get('AVATAR_MAX_HEIGHT').'x'.Config::Get('AVATAR_MAX_WIDTH');?>px</p>
	</dd>
    </div>
	<dt>Current Avatar:</dt>
    <div class="form-group">
	<dd><?php	
			if(!file_exists(SITE_ROOT.AVATAR_PATH.'/'.$pilotcode.'.png')) {
				echo 'None selected';
			} else {
		?>
			<img src="<?php	echo SITE_URL.AVATAR_PATH.'/'.$pilotcode.'.png';?>" /></dd>
		<?php
		}
		?>
	<dt></dt>
    </div>
        </div>
	<dd><input type="hidden" name="action" value="saveprofile" />
		<button class="btn btn-primary waves-effect waves-light w-md" input type="submit" name="submit" value="Save Changes" type="submit"> save</button></dd>
        </div>
</dl>
</form>
                                    </div> 
                                </div>
                                <!-- Personal-Information -->
                            </div> 
                            
                                                       <div class="tab-pane active" id="home-1"> 
                                <div class="row">
                                    <div class="col-md-12">
                                        <!-- Personal-Information -->
                                        <div class="panel panel-default panel-fill">
                                            <div class="panel-heading"> 
                                                <h3 class="panel-title">Change Password</h3> 
                                            </div> 
                                            <div class="panel-body"> 
                                               
<form action="http://www.crew.aalvirtual.com/index.php/profile" method="post">
<dl>

	<dt>Enter your new password</dt>
	<dd><input type="password" id="password" name="password1" value="" /></dd>
	
	<dt>Enter your new password again</dt>
	<dd><input type="password" name="password2" value="" /></dd>
	
	<dt>Enter your old password</dt>
	<dd><input type="password" name="oldpassword" /></dd>
	
	<dt></dt>
	<dd><input type="hidden" name="action" value="changepassword" />
		<input type="submit" name="submit" value="Save Password" />
	</dd>
</dl>
</form>
                                            </div> 
                                        </div>
                                        <!-- Personal-Information -->

                                        <!-- Languages -->
                                      
                                        <!-- Languages -->

                                    </div>



                                </div>
                            </div> 
                            <div class="tab-pane active" id="home-3"> 
                                <div class="row">
                                    <div class="col-md-12">
                                        <h1> Your Stats</h1>
        <?php
/*
	Added in 2.0!
*/
$chart_width = '800';
$chart_height = '250';

/* Don't need to change anything below this here */
?>
<div align="center" style="width: 100%;">
	<div align="center" id="months_data"></div>
</div>
<br />
<div align="center" style="width: 100%;">
	<div align="center" id="aircraft_data"></div>
</div>

<script type="text/javascript" src="http://www.crew.aalvirtual.com/lib/js/ofc/js/swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF("http://www.crew.aalvirtual.com/lib/js/ofc/open-flash-chart.swf", 
	"months_data", "800", "250", 
	"9.0.0", "expressInstall.swf", 
	{"data-file":"<?php echo actionurl('/pilots/statsmonthsdata/'.$pilot->pilotid);?>"});
	
	
<?php
$chart_width = '800';
$chart_height = '300';

/* Don't need to change anything below this here */
?>
swfobject.embedSWF("http://www.crew.aalvirtual.com/lib/js/ofc/open-flash-chart.swf", 
	"aircraft_data", "<?php echo $chart_width;?>", "<?php echo $chart_height;?>", 
	"9.0.0", "expressInstall.swf", 
	{"data-file":"<?php echo actionurl('/pilots/statsaircraftdata/'.$pilot->pilotid);?>"});
</script>
                                    </div>



                                </div>
                            </div> 
                        </div> 
                    </div>
                    </div>
                </div> <!-- container -->

it all exist George.

Link to comment
Share on other sites

  • Moderators

I am using the same code (approximately) and the only issue is with the drop down fields in the administration section. This issue is solved by replacing (in the admin/templates/pilot_details):

$sel = ($field->value === $val) ? 'sel="selected"' : '';

with:

$sel = ($field->value === $val) ? 'selected="selected"' : '';

Does the above solved the issue in the admin part?

  • Like 1
Link to comment
Share on other sites

2 hours ago, servetas said:

I am using the same code (approximately) and the only issue is with the drop down fields in the administration section. This issue is solved by replacing (in the admin/templates/pilot_details):


$sel = ($field->value === $val) ? 'sel="selected"' : '';

with:


$sel = ($field->value === $val) ? 'selected="selected"' : '';

Does the above solved the issue in the admin part?

Thanks George. Now working well.

Link to comment
Share on other sites

From admin, profile fields when i change from dropdown to text i see what pilots choose from dropdown but when i keep as dropdown i don't see what pilots choose... Also for registration form i use phpvms regular skin. Not lib/skins/your_skin/profile_edit.php ...

Edited by OmerAslan
Link to comment
Share on other sites

30 minutes ago, servetas said:

Didn't the drop down issue in the admin center get resolved?

I had same problem with textarea and dropdown. Now textarea works but dropdown not.

Let me explain, I add custom field says how did you heard about us? and i put dropdown: ---, google, valist, through a friend and some more option. During this registration. After they answer and submit form i am checking from my admin side and i see like they didn't pick any staying like first option. --- But i am changing from custom field dropdown to text and i see that pilot pick google as an example. So dropdown not showing. Or i am doing something wrong.

Link to comment
Share on other sites

  • Moderators

Could you please share with me via PM the admin details of your phpVMS system to make a test registration. Set up the system custom fields as you would like them to be. We will share the solution with the rest of the community in this topic.

Link to comment
Share on other sites

7 minutes ago, servetas said:

Could you please share with me via PM the admin details of your phpVMS system to make a test registration. Set up the system custom fields as you would like them to be. We will share the solution with the rest of the community in this topic.

I did my friend. Thanks.

Link to comment
Share on other sites

  • Moderators
On 5/5/2017 at 0:35 PM, servetas said:

I am using the same code (approximately) and the only issue is with the drop down fields in the administration section. This issue is solved by replacing (in the admin/templates/pilot_details):


$sel = ($field->value === $val) ? 'sel="selected"' : '';

with:


$sel = ($field->value === $val) ? 'selected="selected"' : '';

Does the above solved the issue in the admin part?

I registered into your system using a test account and inputed something random in all of the custom fields. I log in as administrator and I can see that the dropdown fields are not selected. Did you do this update in your admin/templates/pilot_details template file?

Link to comment
Share on other sites

  • Moderators

Your system works just file. The dropdown profile fields were not added correctly. You had set the following value in the "Default Value" field:

---, Google, VaList, Through a Friend, VaCentral, SimPilot, Other

based on the text you can see below this field it states clearly: "For dropdowns, separate different options with commas". You had seperated them with ", " (one space). The correct default value is this:

---,Google,VaList,Through a Friend,VaCentral,SimPilot,Other

In the meantime, I found out an issue with the profile fields form and I have submitted a pull request in simpilot's GitHub repoository (pull request #21).

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...