' . $field['lable'] : '';
$html .= isset( $field['lable'] ) ? '
' : '';
if ( ! in_array( $field['type'], $down_desc_fields ) ) {
$html .= isset( $field['desc'] ) ? '
' . $field['desc'] . '
';
switch ( $field['type'] ) {
case 'switch':
$html .= '
';
break;
case 'text':
$html .= '
';
break;
case 'rows':
$html .= '
';
$html .= '
';
$html .= '
';
break;
case 'radio':
if ( isset( $field['options'] ) ) {
foreach ( $field['options'] as $k => $val ) {
$html .= '
';
}
}
break;
case 'slider':
$available_times = array(
'seconds' => __( 'seconds', 'tutor' ),
'minutes' => __( 'minutes', 'tutor' ),
'hours' => __( 'hours', 'tutor' ),
'days' => __( 'days', 'tutor' ),
'weeks' => __( 'weeks', 'tutor' ),
);
$html .= '
';
if ( isset( $field['time'] ) ) {
$html .= '';
$html .= '';
$html .= '' . ( isset( $options[ $key ]['value'] ) ? $options[ $key ]['value'] : '' ) . '';
$html .= isset( $options[ $key ]['time'] ) ? $available_times[ $options[ $key ]['time'] ] : '';
$html .= '';
} else {
$html .= '';
$html .= ' ' . ( isset( $options[ $key ] ) ? $options[ $key ] : '' ) . '';
}
$html .= '
';
break;
case 'dropdown':
$html .= '
';
$selected_data = '';
if ( isset( $field['options'] ) ) {
foreach ( $field['options'] as $value => $label ) {
$html .= '
';
$html .= '';
$html .= '';
$html .= '
';
if ( isset( $options[ $key ] ) && $options[ $key ] === $value ) {
$selected_data .= '
';
$selected_data .= '
' . esc_html( $label ) . '
';
$selected_data .= '';
}
}
}
$html .= '
';
$html .= $selected_data ? $selected_data : '
' . esc_html( $field['options'][0]['title'] ) . '
' . $field['options'][0]['desc'] . '
';
$html .= '
';
break;
case 'select':
$html .= '
';
break;
case 'payments':
$html .= '
';
$available_withdraw_methods = get_tutor_all_withdrawal_methods();
if ( ! empty( $available_withdraw_methods ) ) {
foreach ( $available_withdraw_methods as $key => $value ) {
$html .= '
';
$html .= '
';
$html .= '
';
}
}
$html .= '
';
break;
case 'range':
$earning_instructor = isset( $options['earning_instructor_commission'] ) ? $options['earning_instructor_commission'] : 80;
$earning_admin = isset( $options['earning_admin_commission'] ) ? $options['earning_admin_commission'] : 20;
$html .= '
';
$html .= '
';
$html .= '';
$html .= '
';
$html .= '
';
$html .= '
';
$html .= '
' . $earning_instructor . '%
';
$html .= '' . __( 'Instructor', 'tutor' ) . '
';
$html .= '';
$html .= '';
$html .= '
';
$html .= '
' . $earning_admin . '%
';
$html .= '' . __( 'Admin / Owner', 'tutor' ) . '
';
$html .= '';
$html .= '';
$html .= '
';
$html .= '
';
break;
case 'checkbox':
$html .= '
';
if ( isset( $field['options'] ) ) {
foreach ( $field['options'] as $k => $val ) {
$html .= '
';
$html .= '
';
$html .= '
';
}
}
$html .= '
';
break;
case 'attempt':
$html .= '
';
$html .= '
';
$html .= '
';
$html .= '
';
$html .= '
';
$html .= '
';
break;
default:
// code...
break;
}
if ( in_array( $field['type'], $down_desc_fields ) ) {
$html .= isset( $field['desc'] ) ? '
' . $field['desc'] . '
' : '';
}
$html .= '