diff --git a/edit_form.php b/edit_form.php index 39a1c38..48c6310 100644 --- a/edit_form.php +++ b/edit_form.php @@ -691,7 +691,7 @@ Instrucciones para los usuarios
-(?) +(?)
diff --git a/includes/language.php b/includes/language.php index 49b5de0..a8b38ff 100644 --- a/includes/language.php +++ b/includes/language.php @@ -1,96 +1,97 @@ resaltados abajo.'; - + $lang['error_desc'] = 'Los errores están resaltados abajo.'; + //form buttons $lang['submit_button'] = 'Enviar'; $lang['continue_button'] = 'Continuar'; - $lang['back_button'] = 'Atrás'; - + $lang['back_button'] = 'Atrás'; + //form status - $lang['form_inactive'] = 'Este formulario está actualmente desactivado.'; - + $lang['form_inactive'] = 'Este formulario está actualmente desactivado.'; + //form password - $lang['form_pass_title'] = 'El acceso a este formulario está protegido por contraseña.'; - $lang['form_pass_desc'] = 'Por favor, introduzca la contraseña.'; - $lang['form_pass_invalid'] = '¡La contraseña no es correcta!'; - + $lang['form_pass_title'] = 'El acceso a este formulario está protegido por contraseña.'; + $lang['form_pass_desc'] = 'Por favor, introduzca la contraseña.'; + $lang['form_pass_invalid'] = '¡La contraseña no es correcta!'; + $lang['form_pass_word'] = 'Contraseña'; + //form review $lang['review_title'] = 'Revise sus datos'; - $lang['review_message'] = 'Por favor, revise los datos que ha introducido. Cuando esté conforme, pulse el botón Enviar para terminar.'; - - //validation message + $lang['review_message'] = 'Por favor, revise los datos que ha introducido. Cuando esté conforme, pulse el botón Enviar para terminar.'; + + //validation message $lang['val_required'] = 'Este campo es obligatorio. Por favor, introduzca un valor.'; $lang['val_required_file'] = 'Este campo es obligatorio. Por favor, indique un fichero.'; - $lang['val_unique'] = 'Este campo requiere un valor único y este valor ya ha sido usado.'; + $lang['val_unique'] = 'Este campo requiere un valor único y este valor ya ha sido usado.'; $lang['val_integer'] = 'El valor introducido tiene que ser un valor entero.'; $lang['val_float'] = 'El valor introducido tiene que ser un valor flotante.'; - $lang['val_numeric'] = 'El valor introducido tiene que ser un número.'; + $lang['val_numeric'] = 'El valor introducido tiene que ser un número.'; $lang['val_min'] = 'El valor de este campo no puede ser menor de %s caracteres.'; $lang['val_max'] = 'El valor de este campo no puede ser mayor de %s caracteres.'; - $lang['val_range'] = 'El valor de este campo no está dentro del rango de %s a %s caracteres.'; - $lang['val_email'] = 'Este campo no tiene una dirección de correo electrónico válida.'; - $lang['val_website'] = 'Este campo no tiene una dirección web válida.'; - $lang['val_username'] = 'Los caracteres de este campo sólo pueden contener letras (a-z), números (0-9) y guiones bajos.'; + $lang['val_range'] = 'El valor de este campo no está dentro del rango de %s a %s caracteres.'; + $lang['val_email'] = 'Este campo no tiene una dirección de correo electrónico válida.'; + $lang['val_website'] = 'Este campo no tiene una dirección web válida.'; + $lang['val_username'] = 'Los caracteres de este campo sólo pueden contener letras (a-z), números (0-9) y guiones bajos.'; $lang['val_equal'] = '%s debe coincidir.'; $lang['val_date'] = 'Este campo no tiene una fecha correcta.'; $lang['val_time'] = 'Este campo no tiene una hora correcta.'; - $lang['val_phone'] = 'Por favor, introduzca un número de teléfono válido.'; + $lang['val_phone'] = 'Por favor, introduzca un número de teléfono válido.'; $lang['val_filetype'] = 'The filetype you are attempting to upload is not allowed.'; - + //fields on excel/csv $lang['export_num'] = 'Num.'; - $lang['date_created'] = 'Fecha de creación'; - $lang['date_updated'] = 'Fecha de actualización'; - $lang['ip_address'] = 'Dirección IP'; + $lang['date_created'] = 'Fecha de creación'; + $lang['date_updated'] = 'Fecha de actualización'; + $lang['ip_address'] = 'Dirección IP'; ?> \ No newline at end of file diff --git a/includes/mobile-view-functions.php b/includes/mobile-view-functions.php new file mode 100644 index 0000000..bb681e0 --- /dev/null +++ b/includes/mobile-view-functions.php @@ -0,0 +1,2597 @@ +is_error)){ + $error_message = "

{$element->error_message}

"; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

id}\">{$element->guidelines}

"; + } + + //check for populated value, if exist, use it instead default_value + if(isset($element->populated_value['element_'.$element->id]['default_value'])){ + $element->default_value = $element->populated_value['element_'.$element->id]['default_value']; + } + + +$element_markup = <<{$element->title} {$span_required} + {$error_message} + {$guidelines} + +EOT; + + /*
  • + +
    + +
    {$guidelines} {$error_message} +
  • */ + + return $element_markup; + } + + + + //Paragraph Text + function display_textarea($element){ + //check for error + $error_message = ''; + $span_required = ''; + $guidelines = ''; + + if(!empty($element->is_error)){ + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + //check for populated value, if exist, use it instead default_value + if(isset($element->populated_value['element_'.$element->id]['default_value'])){ + $element->default_value = $element->populated_value['element_'.$element->id]['default_value']; + } + +$element_markup = <<{$element->title} {$span_required} + {$error_message} + {$guidelines} +
      +
    • + +
    • +
    +EOT; + + /*
  • + +
    + +
    {$guidelines} {$error_message} +
  • */ + + + return $element_markup; + } + + + //File Upload + function display_file($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + //check for populated value (this is being used for edit_entry.php only) + if(!empty($element->populated_value)){ + $file_option = $element->populated_value['element_'.$element->id]['default_value']; //this should be contain html markup to download or delete current file + } + +$element_markup = << + +
    + +
    {$file_option} {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + //Website + function display_url($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + //check for default value + if(empty($element->default_value)){ + $element->default_value = 'http://'; + } + + //check for populated value, if exist, use it instead default_value + if(!empty($element->populated_value['element_'.$element->id]['default_value'])){ + $element->default_value = $element->populated_value['element_'.$element->id]['default_value']; + } + +$element_markup = << + +
    + +
    {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + //Email + function display_email($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + //check for populated value, if exist, use it instead default_value + if(!empty($element->populated_value['element_'.$element->id]['default_value'])){ + $element->default_value = $element->populated_value['element_'.$element->id]['default_value']; + } + +$element_markup = << + +
    + +
    {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + + //Phone - Extended + function display_phone($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + //check default value + if(!empty($element->default_value)){ + //split into (xxx) xxx - xxxx + $default_value_1 = substr($element->default_value,0,3); + $default_value_2 = substr($element->default_value,3,3); + $default_value_3 = substr($element->default_value,6,4); + } + + if(!empty($element->populated_value['element_'.$element->id.'_1']['default_value']) || + !empty($element->populated_value['element_'.$element->id.'_2']['default_value']) || + !empty($element->populated_value['element_'.$element->id.'_3']['default_value']) + ){ + $default_value_1 = ''; + $default_value_2 = ''; + $default_value_3 = ''; + $default_value_1 = $element->populated_value['element_'.$element->id.'_1']['default_value']; + $default_value_2 = $element->populated_value['element_'.$element->id.'_2']['default_value']; + $default_value_3 = $element->populated_value['element_'.$element->id.'_3']['default_value']; + } + + +$element_markup = << + + + - + + + + - + + + + + + + {$guidelines} {$error_message} + +EOT; + + + return $element_markup; + } + + //Phone - Simple + function display_simple_phone($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + //check for populated value + if(!empty($element->populated_value['element_'.$element->id]['default_value'])){ + $element->default_value = $element->populated_value['element_'.$element->id]['default_value']; + } + +$element_markup = << + +
    + +
    {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + + + //Date - Normal + function display_date($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + global $lang; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + $machform_path = ''; + if(!empty($element->machform_path)){ + $machform_path = $element->machform_path; + } + + +$element_markup = << + + + / + + + + / + + + + + + + + + Pick a date. + + + {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + //Date - Normal + function display_europe_date($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + global $lang; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + $machform_path = ''; + if(!empty($element->machform_path)){ + $machform_path = $element->machform_path; + } + +$element_markup = << + + + / + + + + / + + + + + + + + + Pick a date. + + + {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + + //Multiple Choice + function display_radio($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + $option_markup = ''; + + if($element->constraint == 'random'){ + $temp = $element->options; + shuffle($temp); + $element->options = $temp; + } + + foreach ($element->options as $option){ + + if($option->is_default){ + $checked = 'checked="checked"'; + }else{ + $checked = ''; + } + + //check for populated values + if(!empty($element->populated_value['element_'.$element->id]['default_value'])){ + $checked = ''; + if($element->populated_value['element_'.$element->id]['default_value'] == $option->id){ + $checked = 'checked="checked"'; + } + } + + $option_markup .= "id}_{$option->id}\" name=\"element_{$element->id}\" class=\"element radio\" type=\"radio\" value=\"{$option->id}\" {$checked} />\n"; + $option_markup .= "\n"; + } + +$element_markup = << + + + {$option_markup} + {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + //Checkboxes + function display_checkbox($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + //check for populated value first, if any exist, unselect all default value + $is_populated = false; + foreach ($element->options as $option){ + + if(!empty($element->populated_value['element_'.$element->id.'_'.$option->id]['default_value'])){ + $is_populated = true; + break; + } + } + + $option_markup = ''; + + foreach ($element->options as $option){ + if(!$is_populated){ + if($option->is_default){ + $checked = 'checked="checked"'; + }else{ + $checked = ''; + } + }else{ + + if(!empty($element->populated_value['element_'.$element->id.'_'.$option->id]['default_value'])){ + $checked = 'checked="checked"'; + }else{ + $checked = ''; + } + } + + + //$option_markup .= "id}_{$option->id}\" name=\"element_{$element->id}_{$option->id}\" class=\"element checkbox\" type=\"checkbox\" value=\"1\" {$checked} />\n"; + //$option_markup .= "\n"; + $option_markup .= "
  • \n"; + $option_markup .= "{$option->option}\n"; + $option_markup .= "id}_{$option->id}\" name=\"element_{$element->id}_{$option->id}\" class=\"element checkbox\" />\n"; + $option_markup .= "
  • \n"; + } + +$element_markup = <<{$element->title} {$span_required} + {$guidelines} {$error_message} +
      + {$option_markup} +
    +EOT; + +/*
  • + + + {$option_markup} + {$guidelines} {$error_message} +
  • +*/ + + return $element_markup; + } + + + //Dropdown + function display_select($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + $option_markup = ''; + + $has_default = false; + foreach ($element->options as $option){ + + if($option->is_default){ + $selected = 'selected="selected"'; + $has_default = true; + }else{ + $selected = ''; + } + + if(!empty($element->populated_value['element_'.$element->id]['default_value'])){ + $selected = ''; + if($element->populated_value['element_'.$element->id]['default_value'] == $option->id){ + $selected = 'selected="selected"'; + } + } + + $option_markup .= "\n"; + } + + if(!$has_default){ + if(!empty($element->populated_value['element_'.$element->id]['default_value'])){ + $option_markup = ''."\n".$option_markup; + }else{ + $option_markup = ''."\n".$option_markup; + } + } + +$element_markup = << + +
    + +
    {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + + //Name - Simple + function display_simple_name($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + global $lang; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + +$element_markup = << + + + + + + + + + {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + //Name + function display_name($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + global $lang; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + +$element_markup = << + + + + + + + + + + + + + + + + + {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + //Time + function display_time($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + global $lang; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + if(!empty($element->populated_value['element_'.$element->id.'_4']['default_value'])){ + if($element->populated_value['element_'.$element->id.'_4']['default_value'] == 'AM'){ + $selected_am = 'selected'; + }else{ + $selected_pm = 'selected'; + } + } + + if($element->constraint == 'show_seconds'){ + $seconds_markup =<< + + + +EOT; + $seconds_separator = ':'; + }else{ + $seconds_markup = ''; + $seconds_separator = ''; + } + +$element_markup = << + + + : + + + + {$seconds_separator} + + + {$seconds_markup} + + + + {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + + //Price + function display_money($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + global $lang; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + if($element->constraint != 'yen'){ //for dollar, pound and euro + if($element->constraint == 'pound'){ + $main_cur = $lang['price_pound_main']; + $child_cur = $lang['price_pound_sub']; + $cur_symbol = '£'; + }elseif ($element->constraint == 'euro'){ + $main_cur = $lang['price_euro_main']; + $child_cur = $lang['price_euro_sub']; + $cur_symbol = '€'; + }else{ //dollar + $main_cur = $lang['price_dollar_main']; + $child_cur = $lang['price_dollar_sub']; + $cur_symbol = '$'; + } + +$element_markup = << + + {$cur_symbol} + + . + + + + + + + {$guidelines} {$error_message} + +EOT; + + }else{ //for yen, only display one textfield + $main_cur = $lang['price_yen']; + $cur_symbol = '¥'; + +$element_markup = << + + {$cur_symbol} + + + + + {$guidelines} {$error_message} + +EOT; + + } + + + + return $element_markup; + } + + //Section Break + function display_section($element){ + $element->guidelines = nl2br($element->guidelines); +$element_markup = << +

    {$element->title}

    +

    {$element->guidelines}

    + +EOT; + + return $element_markup; + } + + + + //Number + function display_number($element){ + //check for error + $error_message = ''; + $span_required = ''; + $guidelines = ''; + + if(!empty($element->is_error)){ + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + //check for populated value, if exist, use it instead default_value + if(isset($element->populated_value['element_'.$element->id]['default_value'])){ + $element->default_value = $element->populated_value['element_'.$element->id]['default_value']; + } + +$element_markup = <<{$element->title} {$span_required} + {$error_message} + {$guidelines} +
      +
    • + +
    • +
    +EOT; + /*
  • + +
    + +
    {$guidelines} {$error_message} +
  • */ + + return $element_markup; + } + + + + //Address + function display_address($element){ + + $country[0]['label'] = "Afghanistan"; + $country[1]['label'] = "Albania"; + $country[2]['label'] = "Algeria"; + $country[3]['label'] = "Andorra"; + $country[4]['label'] = "Antigua and Barbuda"; + $country[5]['label'] = "Argentina"; + $country[6]['label'] = "Armenia"; + $country[7]['label'] = "Australia"; + $country[8]['label'] = "Austria"; + $country[9]['label'] = "Azerbaijan"; + $country[10]['label'] = "Bahamas"; + $country[11]['label'] = "Bahrain"; + $country[12]['label'] = "Bangladesh"; + $country[13]['label'] = "Barbados"; + $country[14]['label'] = "Belarus"; + $country[15]['label'] = "Belgium"; + $country[16]['label'] = "Belize"; + $country[17]['label'] = "Benin"; + $country[18]['label'] = "Bhutan"; + $country[19]['label'] = "Bolivia"; + $country[20]['label'] = "Bosnia and Herzegovina"; + $country[21]['label'] = "Botswana"; + $country[22]['label'] = "Brazil"; + $country[23]['label'] = "Brunei"; + $country[24]['label'] = "Bulgaria"; + $country[25]['label'] = "Burkina Faso"; + $country[26]['label'] = "Burundi"; + $country[27]['label'] = "Cambodia"; + $country[28]['label'] = "Cameroon"; + $country[29]['label'] = "Canada"; + $country[30]['label'] = "Cape Verde"; + $country[31]['label'] = "Central African Republic"; + $country[32]['label'] = "Chad"; + $country[33]['label'] = "Chile"; + $country[34]['label'] = "China"; + $country[35]['label'] = "Colombia"; + $country[36]['label'] = "Comoros"; + $country[37]['label'] = "Congo"; + $country[38]['label'] = "Costa Rica"; + $country[39]['label'] = "Côte d'Ivoire"; + $country[40]['label'] = "Croatia"; + $country[41]['label'] = "Cuba"; + $country[42]['label'] = "Cyprus"; + $country[43]['label'] = "Czech Republic"; + $country[44]['label'] = "Denmark"; + $country[45]['label'] = "Djibouti"; + $country[46]['label'] = "Dominica"; + $country[47]['label'] = "Dominican Republic"; + $country[48]['label'] = "East Timor"; + $country[49]['label'] = "Ecuador"; + $country[50]['label'] = "Egypt"; + $country[51]['label'] = "El Salvador"; + $country[52]['label'] = "Equatorial Guinea"; + $country[53]['label'] = "Eritrea"; + $country[54]['label'] = "Estonia"; + $country[55]['label'] = "Ethiopia"; + $country[56]['label'] = "Fiji"; + $country[57]['label'] = "Finland"; + $country[58]['label'] = "France"; + $country[59]['label'] = "Gabon"; + $country[60]['label'] = "Gambia"; + $country[61]['label'] = "Georgia"; + $country[62]['label'] = "Germany"; + $country[63]['label'] = "Ghana"; + $country[64]['label'] = "Greece"; + $country[65]['label'] = "Grenada"; + $country[66]['label'] = "Guatemala"; + $country[67]['label'] = "Guinea"; + $country[68]['label'] = "Guinea-Bissau"; + $country[69]['label'] = "Guyana"; + $country[70]['label'] = "Haiti"; + $country[71]['label'] = "Honduras"; + $country[72]['label'] = "Hong Kong"; + $country[73]['label'] = "Hungary"; + $country[74]['label'] = "Iceland"; + $country[75]['label'] = "India"; + $country[76]['label'] = "Indonesia"; + $country[77]['label'] = "Iran"; + $country[78]['label'] = "Iraq"; + $country[79]['label'] = "Ireland"; + $country[80]['label'] = "Israel"; + $country[81]['label'] = "Italy"; + $country[82]['label'] = "Jamaica"; + $country[83]['label'] = "Japan"; + $country[84]['label'] = "Jordan"; + $country[85]['label'] = "Kazakhstan"; + $country[86]['label'] = "Kenya"; + $country[87]['label'] = "Kiribati"; + $country[88]['label'] = "North Korea"; + $country[89]['label'] = "South Korea"; + $country[90]['label'] = "Kuwait"; + $country[91]['label'] = "Kyrgyzstan"; + $country[92]['label'] = "Laos"; + $country[93]['label'] = "Latvia"; + $country[94]['label'] = "Lebanon"; + $country[95]['label'] = "Lesotho"; + $country[96]['label'] = "Liberia"; + $country[97]['label'] = "Libya"; + $country[98]['label'] = "Liechtenstein"; + $country[99]['label'] = "Lithuania"; + $country[100]['label'] = "Luxembourg"; + $country[101]['label'] = "Macedonia"; + $country[102]['label'] = "Madagascar"; + $country[103]['label'] = "Malawi"; + $country[104]['label'] = "Malaysia"; + $country[105]['label'] = "Maldives"; + $country[106]['label'] = "Mali"; + $country[107]['label'] = "Malta"; + $country[108]['label'] = "Marshall Islands"; + $country[109]['label'] = "Mauritania"; + $country[110]['label'] = "Mauritius"; + $country[111]['label'] = "Mexico"; + $country[112]['label'] = "Micronesia"; + $country[113]['label'] = "Moldova"; + $country[114]['label'] = "Monaco"; + $country[115]['label'] = "Mongolia"; + $country[116]['label'] = "Montenegro"; + $country[117]['label'] = "Morocco"; + $country[118]['label'] = "Mozambique"; + $country[119]['label'] = "Myanmar"; + $country[120]['label'] = "Namibia"; + $country[121]['label'] = "Nauru"; + $country[122]['label'] = "Nepal"; + $country[123]['label'] = "Netherlands"; + $country[124]['label'] = "New Zealand"; + $country[125]['label'] = "Nicaragua"; + $country[126]['label'] = "Niger"; + $country[127]['label'] = "Nigeria"; + $country[128]['label'] = "Norway"; + $country[129]['label'] = "Oman"; + $country[130]['label'] = "Pakistan"; + $country[131]['label'] = "Palau"; + $country[132]['label'] = "Panama"; + $country[133]['label'] = "Papua New Guinea"; + $country[134]['label'] = "Paraguay"; + $country[135]['label'] = "Peru"; + $country[136]['label'] = "Philippines"; + $country[137]['label'] = "Poland"; + $country[138]['label'] = "Portugal"; + $country[139]['label'] = "Puerto Rico"; + $country[140]['label'] = "Qatar"; + $country[141]['label'] = "Romania"; + $country[142]['label'] = "Russia"; + $country[143]['label'] = "Rwanda"; + $country[144]['label'] = "Saint Kitts and Nevis"; + $country[145]['label'] = "Saint Lucia"; + $country[146]['label'] = "Saint Vincent and the Grenadines"; + $country[147]['label'] = "Samoa"; + $country[148]['label'] = "San Marino"; + $country[149]['label'] = "Sao Tome and Principe"; + $country[150]['label'] = "Saudi Arabia"; + $country[151]['label'] = "Senegal"; + $country[152]['label'] = "Serbia and Montenegro"; + $country[153]['label'] = "Seychelles"; + $country[154]['label'] = "Sierra Leone"; + $country[155]['label'] = "Singapore"; + $country[156]['label'] = "Slovakia"; + $country[157]['label'] = "Slovenia"; + $country[158]['label'] = "Solomon Islands"; + $country[159]['label'] = "Somalia"; + $country[160]['label'] = "South Africa"; + $country[161]['label'] = "Spain"; + $country[162]['label'] = "Sri Lanka"; + $country[163]['label'] = "Sudan"; + $country[164]['label'] = "Suriname"; + $country[165]['label'] = "Swaziland"; + $country[166]['label'] = "Sweden"; + $country[167]['label'] = "Switzerland"; + $country[168]['label'] = "Syria"; + $country[169]['label'] = "Taiwan"; + $country[170]['label'] = "Tajikistan"; + $country[171]['label'] = "Tanzania"; + $country[172]['label'] = "Thailand"; + $country[173]['label'] = "Togo"; + $country[174]['label'] = "Tonga"; + $country[175]['label'] = "Trinidad and Tobago"; + $country[176]['label'] = "Tunisia"; + $country[177]['label'] = "Turkey"; + $country[178]['label'] = "Turkmenistan"; + $country[179]['label'] = "Tuvalu"; + $country[180]['label'] = "Uganda"; + $country[181]['label'] = "Ukraine"; + $country[182]['label'] = "United Arab Emirates"; + $country[183]['label'] = "United Kingdom"; + $country[184]['label'] = "United States"; + $country[185]['label'] = "Uruguay"; + $country[186]['label'] = "Uzbekistan"; + $country[187]['label'] = "Vanuatu"; + $country[188]['label'] = "Vatican City"; + $country[189]['label'] = "Venezuela"; + $country[190]['label'] = "Vietnam"; + $country[191]['label'] = "Yemen"; + $country[192]['label'] = "Zambia"; + $country[193]['label'] = "Zimbabwe"; + + + $country[0]['value'] = "Afghanistan"; + $country[1]['value'] = "Albania"; + $country[2]['value'] = "Algeria"; + $country[3]['value'] = "Andorra"; + $country[4]['value'] = "Antigua and Barbuda"; + $country[5]['value'] = "Argentina"; + $country[6]['value'] = "Armenia"; + $country[7]['value'] = "Australia"; + $country[8]['value'] = "Austria"; + $country[9]['value'] = "Azerbaijan"; + $country[10]['value'] = "Bahamas"; + $country[11]['value'] = "Bahrain"; + $country[12]['value'] = "Bangladesh"; + $country[13]['value'] = "Barbados"; + $country[14]['value'] = "Belarus"; + $country[15]['value'] = "Belgium"; + $country[16]['value'] = "Belize"; + $country[17]['value'] = "Benin"; + $country[18]['value'] = "Bhutan"; + $country[19]['value'] = "Bolivia"; + $country[20]['value'] = "Bosnia and Herzegovina"; + $country[21]['value'] = "Botswana"; + $country[22]['value'] = "Brazil"; + $country[23]['value'] = "Brunei"; + $country[24]['value'] = "Bulgaria"; + $country[25]['value'] = "Burkina Faso"; + $country[26]['value'] = "Burundi"; + $country[27]['value'] = "Cambodia"; + $country[28]['value'] = "Cameroon"; + $country[29]['value'] = "Canada"; + $country[30]['value'] = "Cape Verde"; + $country[31]['value'] = "Central African Republic"; + $country[32]['value'] = "Chad"; + $country[33]['value'] = "Chile"; + $country[34]['value'] = "China"; + $country[35]['value'] = "Colombia"; + $country[36]['value'] = "Comoros"; + $country[37]['value'] = "Congo"; + $country[38]['value'] = "Costa Rica"; + $country[39]['value'] = "Côte d'Ivoire"; + $country[40]['value'] = "Croatia"; + $country[41]['value'] = "Cuba"; + $country[42]['value'] = "Cyprus"; + $country[43]['value'] = "Czech Republic"; + $country[44]['value'] = "Denmark"; + $country[45]['value'] = "Djibouti"; + $country[46]['value'] = "Dominica"; + $country[47]['value'] = "Dominican Republic"; + $country[48]['value'] = "East Timor"; + $country[49]['value'] = "Ecuador"; + $country[50]['value'] = "Egypt"; + $country[51]['value'] = "El Salvador"; + $country[52]['value'] = "Equatorial Guinea"; + $country[53]['value'] = "Eritrea"; + $country[54]['value'] = "Estonia"; + $country[55]['value'] = "Ethiopia"; + $country[56]['value'] = "Fiji"; + $country[57]['value'] = "Finland"; + $country[58]['value'] = "France"; + $country[59]['value'] = "Gabon"; + $country[60]['value'] = "Gambia"; + $country[61]['value'] = "Georgia"; + $country[62]['value'] = "Germany"; + $country[63]['value'] = "Ghana"; + $country[64]['value'] = "Greece"; + $country[65]['value'] = "Grenada"; + $country[66]['value'] = "Guatemala"; + $country[67]['value'] = "Guinea"; + $country[68]['value'] = "Guinea-Bissau"; + $country[69]['value'] = "Guyana"; + $country[70]['value'] = "Haiti"; + $country[71]['value'] = "Honduras"; + $country[72]['value'] = "Hong Kong"; + $country[73]['value'] = "Hungary"; + $country[74]['value'] = "Iceland"; + $country[75]['value'] = "India"; + $country[76]['value'] = "Indonesia"; + $country[77]['value'] = "Iran"; + $country[78]['value'] = "Iraq"; + $country[79]['value'] = "Ireland"; + $country[80]['value'] = "Israel"; + $country[81]['value'] = "Italy"; + $country[82]['value'] = "Jamaica"; + $country[83]['value'] = "Japan"; + $country[84]['value'] = "Jordan"; + $country[85]['value'] = "Kazakhstan"; + $country[86]['value'] = "Kenya"; + $country[87]['value'] = "Kiribati"; + $country[88]['value'] = "North Korea"; + $country[89]['value'] = "South Korea"; + $country[90]['value'] = "Kuwait"; + $country[91]['value'] = "Kyrgyzstan"; + $country[92]['value'] = "Laos"; + $country[93]['value'] = "Latvia"; + $country[94]['value'] = "Lebanon"; + $country[95]['value'] = "Lesotho"; + $country[96]['value'] = "Liberia"; + $country[97]['value'] = "Libya"; + $country[98]['value'] = "Liechtenstein"; + $country[99]['value'] = "Lithuania"; + $country[100]['value'] = "Luxembourg"; + $country[101]['value'] = "Macedonia"; + $country[102]['value'] = "Madagascar"; + $country[103]['value'] = "Malawi"; + $country[104]['value'] = "Malaysia"; + $country[105]['value'] = "Maldives"; + $country[106]['value'] = "Mali"; + $country[107]['value'] = "Malta"; + $country[108]['value'] = "Marshall Islands"; + $country[109]['value'] = "Mauritania"; + $country[110]['value'] = "Mauritius"; + $country[111]['value'] = "Mexico"; + $country[112]['value'] = "Micronesia"; + $country[113]['value'] = "Moldova"; + $country[114]['value'] = "Monaco"; + $country[115]['value'] = "Mongolia"; + $country[116]['value'] = "Montenegro"; + $country[117]['value'] = "Morocco"; + $country[118]['value'] = "Mozambique"; + $country[119]['value'] = "Myanmar"; + $country[120]['value'] = "Namibia"; + $country[121]['value'] = "Nauru"; + $country[122]['value'] = "Nepal"; + $country[123]['value'] = "Netherlands"; + $country[124]['value'] = "New Zealand"; + $country[125]['value'] = "Nicaragua"; + $country[126]['value'] = "Niger"; + $country[127]['value'] = "Nigeria"; + $country[128]['value'] = "Norway"; + $country[129]['value'] = "Oman"; + $country[130]['value'] = "Pakistan"; + $country[131]['value'] = "Palau"; + $country[132]['value'] = "Panama"; + $country[133]['value'] = "Papua New Guinea"; + $country[134]['value'] = "Paraguay"; + $country[135]['value'] = "Peru"; + $country[136]['value'] = "Philippines"; + $country[137]['value'] = "Poland"; + $country[138]['value'] = "Portugal"; + $country[139]['value'] = "Puerto Rico"; + $country[140]['value'] = "Qatar"; + $country[141]['value'] = "Romania"; + $country[142]['value'] = "Russia"; + $country[143]['value'] = "Rwanda"; + $country[144]['value'] = "Saint Kitts and Nevis"; + $country[145]['value'] = "Saint Lucia"; + $country[146]['value'] = "Saint Vincent and the Grenadines"; + $country[147]['value'] = "Samoa"; + $country[148]['value'] = "San Marino"; + $country[149]['value'] = "Sao Tome and Principe"; + $country[150]['value'] = "Saudi Arabia"; + $country[151]['value'] = "Senegal"; + $country[152]['value'] = "Serbia and Montenegro"; + $country[153]['value'] = "Seychelles"; + $country[154]['value'] = "Sierra Leone"; + $country[155]['value'] = "Singapore"; + $country[156]['value'] = "Slovakia"; + $country[157]['value'] = "Slovenia"; + $country[158]['value'] = "Solomon Islands"; + $country[159]['value'] = "Somalia"; + $country[160]['value'] = "South Africa"; + $country[161]['value'] = "Spain"; + $country[162]['value'] = "Sri Lanka"; + $country[163]['value'] = "Sudan"; + $country[164]['value'] = "Suriname"; + $country[165]['value'] = "Swaziland"; + $country[166]['value'] = "Sweden"; + $country[167]['value'] = "Switzerland"; + $country[168]['value'] = "Syria"; + $country[169]['value'] = "Taiwan"; + $country[170]['value'] = "Tajikistan"; + $country[171]['value'] = "Tanzania"; + $country[172]['value'] = "Thailand"; + $country[173]['value'] = "Togo"; + $country[174]['value'] = "Tonga"; + $country[175]['value'] = "Trinidad and Tobago"; + $country[176]['value'] = "Tunisia"; + $country[177]['value'] = "Turkey"; + $country[178]['value'] = "Turkmenistan"; + $country[179]['value'] = "Tuvalu"; + $country[180]['value'] = "Uganda"; + $country[181]['value'] = "Ukraine"; + $country[182]['value'] = "United Arab Emirates"; + $country[183]['value'] = "United Kingdom"; + $country[184]['value'] = "United States"; + $country[185]['value'] = "Uruguay"; + $country[186]['value'] = "Uzbekistan"; + $country[187]['value'] = "Vanuatu"; + $country[188]['value'] = "Vatican City"; + $country[189]['value'] = "Venezuela"; + $country[190]['value'] = "Vietnam"; + $country[191]['value'] = "Yemen"; + $country[192]['value'] = "Zambia"; + $country[193]['value'] = "Zimbabwe"; + + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + global $lang; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + + //create country markup, if no default value, provide a blank option + if(empty($element->default_value)){ + $country_markup = ''."\n"; + }else{ + $country_markup = ''; + } + + foreach ($country as $data){ + if($data['value'] == $element->default_value){ + $selected = 'selected="selected"'; + }else{ + $selected = ''; + } + + //check for populated value, use it instead of default value + if(!empty($element->populated_value['element_'.$element->id.'_6']['default_value'])){ + $selected = ''; + if($element->populated_value['element_'.$element->id.'_6']['default_value'] == $data['value']){ + $selected = 'selected="selected"'; + } + } + + $country_markup .= "\n"; + } + +$element_markup = << + + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
     {$guidelines} {$error_message} + +EOT; + + + return $element_markup; + } + + + //Captcha + function display_captcha($element){ + + if(!empty($element->error_message)){ + $error_code = $element->error_message; + }else{ + $error_code = ''; + } + + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + global $lang; + + if(!empty($element->is_error)){ + + if($element->error_message == 'el-required'){ + $element->error_message = $lang['captcha_required']; + $error_code = ''; + }elseif ($element->error_message == 'incorrect-captcha-sol'){ + $element->error_message = $lang['captcha_mismatch']; + }else{ + $element->error_message = "{$lang['captcha_error']} ({$element->error_message})"; + } + + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + if(!empty($_SERVER['HTTPS'])){ + $use_ssl = true; + }else{ + $use_ssl = false; + } + + + if(USE_INTERNAL_CAPTCHA === true){ //use the internal captcha if enabled + + $machform_path = ''; + if(!empty($element->machform_path)){ + $machform_path = $element->machform_path; + } + + $timestamp = time(); //use this as paramater for captcha.php, to prevent caching + + $element->title = $lang['captcha_title']; +$captcha_html = <<
    +
    +EOT; + + }else{ //otherwise use the reCAPTCHA + $captcha_html = recaptcha_get_html(RECAPTCHA_PUBLIC_KEY, $error_code,$use_ssl); + + if($captcha_html === false){ + $domain = str_replace('www.','',$_SERVER['SERVER_NAME']); + $captcha_html = "Error! You have enabled CAPTCHA but no API key available.

    To use CAPTCHA you must get an API key from http://recaptcha.net/api/getkey

    After getting the API key, save them into your config.php file."; + $error_class = 'class="error"'; + } + } + + + if(function_exists("form{$element->form_id}_hook_pre_captcha")){ + $custom_precaptcha = call_user_func("form{$element->form_id}_hook_pre_captcha"); + } + +$element_markup = << {$custom_precaptcha} + +
    + {$captcha_html} +
    + {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + + //Main function to display a form + //There are few mode when displaying a form + //1. New blank form (form populated with default values) + //2. New form with error (displayed when 1 submitted and having error, form populated with user inputs) + //3. Edit form (form populated with data from db) + //4. Edit form with error (displayed when 3 submiteed and having error) + function display_form($form_id,$populated_values=array(),$error_elements=array(),$custom_error='',$edit_id=0,$embed=false){ + + global $lang; + + //if there is custom error, don't show other errors + if(!empty($custom_error)){ + $error_elements = array(); + } + + //get form properties data + $query = "select + form_name, + form_description, + form_redirect, + form_success_message, + form_password, + form_unique_ip, + form_frame_height, + form_has_css, + form_active, + form_captcha, + form_review + from + ap_forms + where + form_id='$form_id'"; + $result = do_query($query); + $row = do_fetch_result($result); + + $form = new \stdClass(); + + $form->id = $form_id; + $form->name = $row['form_name']; + $form->description = $row['form_description']; + $form->redirect = $row['form_redirect']; + $form->success_message = $row['form_success_message']; + $form->password = $row['form_password']; + $form->frame_height = $row['form_frame_height']; + $form->unique_ip = $row['form_unique_ip']; + $form->has_css = $row['form_has_css']; + $form->active = $row['form_active']; + $form->captcha = $row['form_captcha']; + $form->review = $row['form_review']; + + if(empty($error_elements)){ + $form->is_error = 0; + }else{ + $form->is_error = 1; + } + + //if this form has review enabled and user are having $_SESSION['review_id'], then populate the form with that values + if(!empty($form->review) && !empty($_SESSION['review_id']) && empty($populated_values)){ + $populated_values = get_entry_values($form_id,$_SESSION['review_id'],true); + } + + //get elements data + //get element options first and store it into array + $query = "select + element_id, + option_id, + `position`, + `option`, + option_is_default + from + ap_element_options + where + form_id='$form_id' and live=1 + order by + element_id asc,`position` asc"; + $result = do_query($query); + while($row = do_fetch_result($result)){ + $element_id = $row['element_id']; + $option_id = $row['option_id']; + $options_lookup[$element_id][$option_id]['position'] = $row['position']; + $options_lookup[$element_id][$option_id]['option'] = $row['option']; + $options_lookup[$element_id][$option_id]['option_is_default'] = $row['option_is_default']; + } + + + //get elements data + $element = array(); + $query = "select + element_id, + element_title, + element_guidelines, + element_size, + element_is_required, + element_is_unique, + element_is_private, + element_type, + element_position, + element_default_value, + element_constraint + from + ap_form_elements + where + form_id='$form_id' + order by + element_position asc"; + $result = do_query($query); + + $j=0; + $has_calendar = false; //assume the form doesn't have calendar, so it won't load calendar.js + while($row = do_fetch_result($result)){ + $element_id = $row['element_id']; + + //lookup element options first + if(!empty($options_lookup[$element_id])){ + $element_options = array(); + $i=0; + foreach ($options_lookup[$element_id] as $option_id=>$data){ + $element_options[$i] = new \stdClass(); + $element_options[$i]->id = $option_id; + $element_options[$i]->option = $data['option']; + $element_options[$i]->is_default = $data['option_is_default']; + $element_options[$i]->is_db_live = 1; + $i++; + } + } + + + //populate elements + $element[$j] = new \stdClass(); + $element[$j]->title = nl2br($row['element_title']); + $element[$j]->guidelines = $row['element_guidelines']; + $element[$j]->size = $row['element_size']; + $element[$j]->is_required = $row['element_is_required']; + $element[$j]->is_unique = $row['element_is_unique']; + $element[$j]->is_private = $row['element_is_private']; + $element[$j]->type = $row['element_type']; + $element[$j]->position = $row['element_position']; + $element[$j]->id = $row['element_id']; + $element[$j]->is_db_live = 1; + + //this data came from db or form submit + //being used to display edit form or redisplay form with errors and previous inputs + //this should be optimized in the future, only pass necessary data, not the whole array + $element[$j]->populated_value = $populated_values; + + //if there is file upload type, set form enctype to multipart + if($row['element_type'] == 'file'){ + $form_enc_type = 'enctype="multipart/form-data"'; + } + + if(!empty($error_elements[$element[$j]->id])){ + $element[$j]->is_error = 1; + $element[$j]->error_message = $error_elements[$element[$j]->id]; + } + + + $element[$j]->default_value = htmlspecialchars($row['element_default_value']); + + + $element[$j]->constraint = $row['element_constraint']; + if(!empty($element_options)){ + $element[$j]->options = $element_options; + }else{ + $element[$j]->options = ''; + } + + + //check for calendar type + if($row['element_type'] == 'date' || $row['element_type'] == 'europe_date'){ + $has_calendar = true; + } + + $j++; + } + + + //add captcha if enable + if(!empty($form->captcha) && (empty($edit_id))){ + $element[$j] = new \stdClass(); + $element[$j]->type = 'captcha'; + $element[$j]->form_id = $form_id; + $element[$j]->is_private = 0; + + if(!empty($error_elements['element_captcha'])){ + $element[$j]->is_error = 1; + $element[$j]->error_message = $error_elements['element_captcha']; + } + } + + //generate html markup for each element + $all_element_markup = ''; + foreach ($element as $element_data){ + if($element_data->is_private && empty($_SESSION['logged_in'])){ //don't show private element + continue; + } + $all_element_markup .= call_user_func(__NAMESPACE__ .'\display_'.$element_data->type,$element_data); + } + + if(!empty($custom_error)){ + $form->error_message =<< +
  • + {$custom_error}

    +

  • + +EOT; + /*
  • +

    {$custom_error}

    +
  • */ + }elseif(!empty($error_elements)){ + $form->error_message =<< +
  • + {$lang['error_title']}

    +

    {$lang['error_desc']}

    +
  • + +EOT; + /*
  • +

    {$lang['error_title']}

    +

    {$lang['error_desc']}

    +
  • */ + + } + + + //display edit_id if there is any + if(!empty($edit_id)){ + $edit_markup = "\n"; + }else{ + $edit_markup = ''; + } + + if(empty($form->review)){ + $button_text = $lang['submit_button']; + }else{ + $button_text = $lang['continue_button']; + } + + //markup for submit button + $button_markup =<< +
      +
    • + + {$edit_markup} + + +
    +EOT; + + /*
  • + + {$edit_markup} + + +
  • */ + + //check for specific form css, if any, use it instead + if($form->has_css){ + $css_dir = "mobile/apple/css/"; + } + + if(!empty($form->password) && empty($_SESSION['user_authenticated'])){ //if form require password and password hasn't set yet + $show_password_form = true; + + }elseif (!empty($form->password) && !empty($_SESSION['user_authenticated']) && $_SESSION['user_authenticated'] != $form_id){ //if user authenticated but not for this form + $show_password_form = true; + + }else{ //user authenticated for this form, or no password required + $show_password_form = false; + } + + + if(empty($form->active)){ //if form is not active, don't show the fields + $form_desc_div =''; + $all_element_markup = ''; + $button_markup = ''; + $ul_class = 'class="password"'; + $custom_element =<< +

    {$lang['form_inactive']}

    + +EOT; + }elseif($show_password_form){ //don't show form description if this page is password protected and user not authenticated + $form_desc_div =''; + $all_element_markup = ''; + $custom_element =<<{$lang['form_pass_desc']} +
      +
    • + {$lang['form_pass_word']} +
    • + +
    +

    {$lang['form_pass_title']}

    +EOT; + /*
  • +

    {$lang['form_pass_title']}

    +
    + + +
    +
  • */ + + $ul_class = 'class="password"'; + }else{ + if(!empty($form->name) || !empty($form->description)){ + $form->description = nl2br($form->description); + $form_desc_div =<< +
  • + {$form->name} +

    {$form->description}

    +
  • + +EOT; + } + } + + if($embed){ + $embed_class = 'class="embed"'; + } + + if($has_calendar){ + $calendar_js = ''; + }else{ + $calendar_js = ''; + } + + + //If you would like to remove the "Powered by MachForm" link, please contact us at customer.service@appnitro.com before doing so + $form_markup = << + + + + + + + + + +{$form->name} + + + +
    +
    {$form->name}
    +
    +
    + {$form_desc_div} + +
    + {$form->error_message} + {$all_element_markup} + {$custom_element} + {$button_markup} +
    +
    + + + +EOT; + return $form_markup; + + } + + //this function is similar as display_form, but designed to display form without IFRAME + function display_integrated_form($form_id,$populated_values=array(),$error_elements=array(),$custom_error='',$edit_id=0,$machform_path){ + + global $lang; + + //if there is custom error, don't show other errors + if(!empty($custom_error)){ + $error_elements = array(); + } + + //get form properties data + $query = "select + form_name, + form_description, + form_redirect, + form_success_message, + form_password, + form_unique_ip, + form_frame_height, + form_has_css, + form_active, + form_captcha, + form_review + from + ap_forms + where + form_id='$form_id'"; + $result = do_query($query); + $row = do_fetch_result($result); + + $form = new \stdClass(); + + $form->id = $form_id; + $form->name = $row['form_name']; + $form->description = $row['form_description']; + $form->redirect = $row['form_redirect']; + $form->success_message = $row['form_success_message']; + $form->password = $row['form_password']; + $form->frame_height = $row['form_frame_height']; + $form->unique_ip = $row['form_unique_ip']; + $form->has_css = $row['form_has_css']; + $form->active = $row['form_active']; + $form->captcha = $row['form_captcha']; + $form->review = $row['form_review']; + + if(empty($error_elements)){ + $form->is_error = 0; + }else{ + $form->is_error = 1; + } + + //if this form has review enabled and user are having $_SESSION['review_id'], then populate the form with that values + if(!empty($form->review) && !empty($_SESSION['review_id']) && empty($populated_values)){ + $param['machform_path'] = $machform_path; + $populated_values = get_entry_values($form_id,$_SESSION['review_id'],true,$param); + } + + //get elements data + //get element options first and store it into array + $query = "select + element_id, + option_id, + `position`, + `option`, + option_is_default + from + ap_element_options + where + form_id='$form_id' and live=1 + order by + element_id asc,`position` asc"; + $result = do_query($query); + while($row = do_fetch_result($result)){ + $element_id = $row['element_id']; + $option_id = $row['option_id']; + $options_lookup[$element_id][$option_id]['position'] = $row['position']; + $options_lookup[$element_id][$option_id]['option'] = $row['option']; + $options_lookup[$element_id][$option_id]['option_is_default'] = $row['option_is_default']; + } + + + //get elements data + $element = array(); + $query = "select + element_id, + element_title, + element_guidelines, + element_size, + element_is_required, + element_is_unique, + element_is_private, + element_type, + element_position, + element_default_value, + element_constraint + from + ap_form_elements + where + form_id='$form_id' + order by + element_position asc"; + $result = do_query($query); + + $j=0; + $has_calendar = false; + while($row = do_fetch_result($result)){ + $element_id = $row['element_id']; + + //lookup element options first + if(!empty($options_lookup[$element_id])){ + $element_options = array(); + $i=0; + foreach ($options_lookup[$element_id] as $option_id=>$data){ + $element_options[$i] = new \stdClass(); + $element_options[$i]->id = $option_id; + $element_options[$i]->option = $data['option']; + $element_options[$i]->is_default = $data['option_is_default']; + $element_options[$i]->is_db_live = 1; + $i++; + } + } + + + //populate elements + $element[$j] = new \stdClass(); + $element[$j]->title = nl2br($row['element_title']); + + if(empty($edit_id)){ + $element[$j]->guidelines = $row['element_guidelines']; + }else{ + $element[$j]->guidelines = ''; + } + + $element[$j]->size = $row['element_size']; + $element[$j]->is_required = $row['element_is_required']; + $element[$j]->is_unique = $row['element_is_unique']; + $element[$j]->is_private = $row['element_is_private']; + $element[$j]->type = $row['element_type']; + $element[$j]->position = $row['element_position']; + $element[$j]->id = $row['element_id']; + $element[$j]->is_db_live = 1; + $element[$j]->machform_path = $machform_path; + + //this data came from db or form submit + //being used to display edit form or redisplay form with errors and previous inputs + //this should be optimized in the future, only pass necessary data, not the whole array + $element[$j]->populated_value = $populated_values; + + //if there is file upload type, set form enctype to multipart + if($row['element_type'] == 'file'){ + $form_enc_type = 'enctype="multipart/form-data"'; + } + + if(!empty($error_elements[$element[$j]->id])){ + $element[$j]->is_error = 1; + $element[$j]->error_message = $error_elements[$element[$j]->id]; + } + + + $element[$j]->default_value = htmlspecialchars($row['element_default_value']); + + + $element[$j]->constraint = $row['element_constraint']; + if(!empty($element_options)){ + $element[$j]->options = $element_options; + }else{ + $element[$j]->options = ''; + } + + //check for calendar type + if($row['element_type'] == 'date' || $row['element_type'] == 'europe_date'){ + $has_calendar = true; + } + + $j++; + } + + + //add captcha if enable + if(!empty($form->captcha) && (empty($edit_id))){ + $element[$j] = new \stdClass(); + $element[$j]->type = 'captcha'; + $element[$j]->form_id = $form_id; + $element[$j]->machform_path = $machform_path; + + if(!empty($error_elements['element_captcha'])){ + $element[$j]->is_error = 1; + $element[$j]->error_message = $error_elements['element_captcha']; + } + } + + //generate html markup for each element + $all_element_markup = ''; + foreach ($element as $element_data){ + if($element_data->is_private && empty($_SESSION['logged_in'])){ //don't show private element + continue; + } + $all_element_markup .= call_user_func('display_'.$element_data->type,$element_data); + } + + if(!empty($custom_error)){ + $form->error_message =<< +

    {$custom_error}

    + +EOT; + }elseif(!empty($error_elements)){ + $form->error_message =<< +

    {$lang['error_title']}

    +

    {$lang['error_desc']}

    + +EOT; + } + + if(!empty($form->password) && empty($_SESSION['user_authenticated'])){ //if form require password and password hasn't set yet + $show_password_form = true; + + }elseif (!empty($form->password) && !empty($_SESSION['user_authenticated']) && $_SESSION['user_authenticated'] != $form_id){ //if user authenticated but not for this form + $show_password_form = true; + + }else{ //user authenticated for this form, or no password required + $show_password_form = false; + } + + //display edit_id if there is any + if(!empty($edit_id)){ + $edit_markup = "\n"; + $submit_button = ''; + }else{ + $edit_markup = ''; + + if(!empty($form->review) && !$show_password_form){ + $submit_button = ''."\n".''; + }else{ + $submit_button = ''."\n".''; + } + } + + + //markup for submit button + $button_markup =<< + + {$edit_markup} + {$submit_button} + +EOT; + + //check for specific form css, if any, use it instead + if($form->has_css){ + $css_dir = DATA_DIR."/form_{$form_id}/css/"; + } + + + if(empty($form->active)){ //if form is not active, don't show the fields + $form_desc_div =''; + $all_element_markup = ''; + $button_markup = ''; + $ul_class = 'class="password"'; + $custom_element =<< +

    {$lang['form_inactive']}

    + +EOT; + }elseif($show_password_form){ //don't show form description if this page is password protected and user not authenticated + $form_desc_div =''; + $all_element_markup = ''; + $custom_element =<< +

    {$lang['form_pass_title']}

    +
    + + +
    + +EOT; + $ul_class = 'class="password"'; + }else{ + if(!empty($form->name) || !empty($form->description)){ + $form->description = nl2br($form->description); + $form_desc_div =<< +

    {$form->name}

    +

    {$form->description}

    +
    +EOT; + } + } + + + $embed_class = 'class="integrated"'; + + if(empty($edit_id)){ + $css_markup = ""; + }else{ + $css_markup = ""; + } + + if($has_calendar){ + $calendar_js = ""; + }else{ + $calendar_js = ''; + } + + + //If you would like to remove the "Powered by MachForm" link, please contact us at customer.service@appnitro.com before doing so + $form_markup =<< +{$calendar_js} + +
    + +
    + +

    {$form->name}

    +
    + {$form_desc_div} +
      + {$form->error_message} + {$all_element_markup} + {$custom_element} + {$button_markup} +
    +
    + +
    +
    +EOT; + return $form_markup; + + } + + function display_success($form_id,$embed=false){ + //get form properties data + $query = "select + form_success_message, + form_has_css, + form_name + from + ap_forms + where + form_id='$form_id'"; + + $result = do_query($query); + $row = do_fetch_result($result); + + $form = new \stdClass(); + + $form->id = $form_id; + $form->success_message = nl2br($row['form_success_message']); + $form->has_css = $row['form_has_css']; + $form->name = $row['form_name']; + + + //check for specific form css, if any, use it instead + if($form->has_css){ + $css_dir = "mobile/apple/css/"; + } + + if($embed){ + $embed_class = 'class="embed"'; + } + + $form_markup = << + + + + + + + + + +{$form->name} + + + +
    +
    {$form->name}
    +
    +
    +
      +
    • +

      {$form->success_message}

      +
    • +
    +
    + + + +EOT; + +/*$form_markup = << + + + +{$form->name} + + + + + +
    + +

    Appnitro MachForm

    + +
    +

    {$form->success_message}

    +
    + +
    + + + +EOT;*/ + + return $form_markup; + } + + //this function is similar as display_success, but designed to display success page without IFRAME + function display_integrated_success($form_id,$machform_path){ + //get form properties data + $query = "select + form_success_message, + form_has_css + from + ap_forms + where + form_id='$form_id'"; + + $result = do_query($query); + $row = do_fetch_result($result); + + $form = new \stdClass(); + + $form->id = $form_id; + $form->success_message = nl2br($row['form_success_message']); + $form->has_css = $row['form_has_css']; + + + //check for specific form css, if any, use it instead + if($form->has_css){ + $css_dir = DATA_DIR."/form_{$form_id}/css/"; + } + + + $form_markup = << +
    +
    +

    Appnitro MachForm

    + +
    +

    {$form->success_message}

    +
    + +
    +
    +EOT; + return $form_markup; + } + + //display form confirmation page + function display_form_review($form_id,$record_id,$embed=false){ + global $lang; + + //get form properties data + $query = "select + form_has_css, + form_redirect + from + ap_forms + where + form_id='$form_id'"; + + $result = do_query($query); + $row = do_fetch_result($result); + + + $form_has_css = $row['form_has_css']; + $form_redirect = $row['form_redirect']; + + //prepare entry data for previewing + $param['strip_download_link'] = true; + $param['review_mode'] = true; + $param['show_attach_image'] = true; + $entry_details = get_entry_details($form_id,$record_id,$param); + + $entry_data = ''."\n"; + + $toggle = false; + foreach ($entry_details as $data){ + if($toggle){ + $toggle = false; + $row_style = 'class="alt"'; + }else{ + $toggle = true; + $row_style = ''; + } + + $entry_data .= "\n"; + $entry_data .= "\n"; + $entry_data .= "\n"; + $entry_data .= "\n"; + } + + $entry_data .= '
    {$data['label']}".nl2br($data['value'])."
    '; + + //check for specific form css, if any, use it instead + if($form_has_css){ + $css_dir = DATA_DIR."/form_{$form_id}/css/"; + } + + if($embed){ + $embed_class = 'class="embed"'; + } + + $form_markup = << + + + +{$form_name} + + + + + + + + +
    + +

    Appnitro MachForm

    +
    +
    +

    {$lang['review_title']}

    +

    {$lang['review_message']}

    +
    + {$entry_data} +
      +
    • + + + +
    • +
    +
    + +
    + + + +EOT; + return $form_markup; + } + + //display form confirmation page for integrated embed code + function display_integrated_form_review($form_id,$record_id,$machform_path){ + global $lang; + + //get form properties data + $query = "select + form_has_css, + form_redirect + from + ap_forms + where + form_id='$form_id'"; + + $result = do_query($query); + $row = do_fetch_result($result); + + + $form_has_css = $row['form_has_css']; + $form_redirect = $row['form_redirect']; + + //prepare entry data for previewing + $param['strip_download_link'] = true; + $param['review_mode'] = true; + $param['show_attach_image'] = true; + $param['machform_path'] = $machform_path; + $entry_details = get_entry_details($form_id,$record_id,$param); + + $entry_data = ''."\n"; + + $toggle = false; + foreach ($entry_details as $data){ + if($toggle){ + $toggle = false; + $row_style = 'class="alt"'; + }else{ + $toggle = true; + $row_style = ''; + } + + $entry_data .= "\n"; + $entry_data .= "\n"; + $entry_data .= "\n"; + $entry_data .= "\n"; + } + + $entry_data .= '
    {$data['label']}".nl2br($data['value'])."
    '; + + //check for specific form css, if any, use it instead + if($form_has_css){ + $css_dir = DATA_DIR."/form_{$form_id}/css/"; + } + + if($embed){ + $embed_class = 'class="embed"'; + } + + $form_action = str_replace(array("&show_review=1","?show_review=1"),"",$_SERVER['REQUEST_URI']); + + $form_markup = << + + + + +
    +
    +

    Appnitro MachForm

    +
    +
    +

    {$lang['review_title']}

    +

    {$lang['review_message']}

    +
    + {$entry_data} +
      +
    • + + + +
    • +
    +
    + +
    +
    +EOT; + return $form_markup; + } +?> \ No newline at end of file diff --git a/includes/standard-view-functions.php b/includes/standard-view-functions.php new file mode 100644 index 0000000..c544826 --- /dev/null +++ b/includes/standard-view-functions.php @@ -0,0 +1,2502 @@ +is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + //check for populated value, if exist, use it instead default_value + if(isset($element->populated_value['element_'.$element->id]['default_value'])){ + $element->default_value = $element->populated_value['element_'.$element->id]['default_value']; + } + + +$element_markup = << + +
    + +
    {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + + + //Paragraph Text + function display_textarea($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + //check for populated value, if exist, use it instead default_value + if(isset($element->populated_value['element_'.$element->id]['default_value'])){ + $element->default_value = $element->populated_value['element_'.$element->id]['default_value']; + } + +$element_markup = << + +
    + +
    {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + + //File Upload + function display_file($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + //check for populated value (this is being used for edit_entry.php only) + if(!empty($element->populated_value)){ + $file_option = $element->populated_value['element_'.$element->id]['default_value']; //this should be contain html markup to download or delete current file + } + +$element_markup = << + +
    + +
    {$file_option} {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + //Website + function display_url($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + //check for default value + if(empty($element->default_value)){ + $element->default_value = 'http://'; + } + + //check for populated value, if exist, use it instead default_value + if(!empty($element->populated_value['element_'.$element->id]['default_value'])){ + $element->default_value = $element->populated_value['element_'.$element->id]['default_value']; + } + +$element_markup = << + +
    + +
    {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + //Email + function display_email($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + //check for populated value, if exist, use it instead default_value + if(!empty($element->populated_value['element_'.$element->id]['default_value'])){ + $element->default_value = $element->populated_value['element_'.$element->id]['default_value']; + } + +$element_markup = << + +
    + +
    {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + + //Phone - Extended + function display_phone($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + //check default value + if(!empty($element->default_value)){ + //split into (xxx) xxx - xxxx + $default_value_1 = substr($element->default_value,0,3); + $default_value_2 = substr($element->default_value,3,3); + $default_value_3 = substr($element->default_value,6,4); + } + + if(!empty($element->populated_value['element_'.$element->id.'_1']['default_value']) || + !empty($element->populated_value['element_'.$element->id.'_2']['default_value']) || + !empty($element->populated_value['element_'.$element->id.'_3']['default_value']) + ){ + $default_value_1 = ''; + $default_value_2 = ''; + $default_value_3 = ''; + $default_value_1 = $element->populated_value['element_'.$element->id.'_1']['default_value']; + $default_value_2 = $element->populated_value['element_'.$element->id.'_2']['default_value']; + $default_value_3 = $element->populated_value['element_'.$element->id.'_3']['default_value']; + } + + +$element_markup = << + + + - + + + + - + + + + + + + {$guidelines} {$error_message} + +EOT; + + + return $element_markup; + } + + //Phone - Simple + function display_simple_phone($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + //check for populated value + if(!empty($element->populated_value['element_'.$element->id]['default_value'])){ + $element->default_value = $element->populated_value['element_'.$element->id]['default_value']; + } + +$element_markup = << + +
    + +
    {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + + + //Date - Normal + function display_date($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + global $lang; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + $machform_path = ''; + if(!empty($element->machform_path)){ + $machform_path = $element->machform_path; + } + + +$element_markup = << + + + / + + + + / + + + + + + + + + Pick a date. + + + {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + //Date - Normal + function display_europe_date($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + global $lang; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + $machform_path = ''; + if(!empty($element->machform_path)){ + $machform_path = $element->machform_path; + } + +$element_markup = << + + + / + + + + / + + + + + + + + + Pick a date. + + + {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + + //Multiple Choice + function display_radio($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + $option_markup = ''; + + if($element->constraint == 'random'){ + $temp = $element->options; + shuffle($temp); + $element->options = $temp; + } + + foreach ($element->options as $option){ + + if($option->is_default){ + $checked = 'checked="checked"'; + }else{ + $checked = ''; + } + + //check for populated values + if(!empty($element->populated_value['element_'.$element->id]['default_value'])){ + $checked = ''; + if($element->populated_value['element_'.$element->id]['default_value'] == $option->id){ + $checked = 'checked="checked"'; + } + } + + $option_markup .= "id}_{$option->id}\" name=\"element_{$element->id}\" class=\"element radio\" type=\"radio\" value=\"{$option->id}\" {$checked} />\n"; + $option_markup .= "\n"; + } + +$element_markup = << + + + {$option_markup} + {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + //Checkboxes + function display_checkbox($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + //check for populated value first, if any exist, unselect all default value + $is_populated = false; + foreach ($element->options as $option){ + + if(!empty($element->populated_value['element_'.$element->id.'_'.$option->id]['default_value'])){ + $is_populated = true; + break; + } + } + + $option_markup = ''; + + foreach ($element->options as $option){ + if(!$is_populated){ + if($option->is_default){ + $checked = 'checked="checked"'; + }else{ + $checked = ''; + } + }else{ + + if(!empty($element->populated_value['element_'.$element->id.'_'.$option->id]['default_value'])){ + $checked = 'checked="checked"'; + }else{ + $checked = ''; + } + } + + + + $option_markup .= "id}_{$option->id}\" name=\"element_{$element->id}_{$option->id}\" class=\"element checkbox\" type=\"checkbox\" value=\"1\" {$checked} />\n"; + $option_markup .= "\n"; + } + +$element_markup = << + + + {$option_markup} + {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + + //Dropdown + function display_select($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + $option_markup = ''; + + $has_default = false; + foreach ($element->options as $option){ + + if($option->is_default){ + $selected = 'selected="selected"'; + $has_default = true; + }else{ + $selected = ''; + } + + if(!empty($element->populated_value['element_'.$element->id]['default_value'])){ + $selected = ''; + if($element->populated_value['element_'.$element->id]['default_value'] == $option->id){ + $selected = 'selected="selected"'; + } + } + + $option_markup .= "\n"; + } + + if(!$has_default){ + if(!empty($element->populated_value['element_'.$element->id]['default_value'])){ + $option_markup = ''."\n".$option_markup; + }else{ + $option_markup = ''."\n".$option_markup; + } + } + +$element_markup = << + +
    + +
    {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + + //Name - Simple + function display_simple_name($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + global $lang; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + +$element_markup = << + + + + + + + + + {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + //Name + function display_name($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + global $lang; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + +$element_markup = << + + + + + + + + + + + + + + + + + {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + //Time + function display_time($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + global $lang; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + if(!empty($element->populated_value['element_'.$element->id.'_4']['default_value'])){ + if($element->populated_value['element_'.$element->id.'_4']['default_value'] == 'AM'){ + $selected_am = 'selected'; + }else{ + $selected_pm = 'selected'; + } + } + + if($element->constraint == 'show_seconds'){ + $seconds_markup =<< + + + +EOT; + $seconds_separator = ':'; + }else{ + $seconds_markup = ''; + $seconds_separator = ''; + } + +$element_markup = << + + + : + + + + {$seconds_separator} + + + {$seconds_markup} + + + + {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + + //Price + function display_money($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + global $lang; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + if($element->constraint != 'yen'){ //for dollar, pound and euro + if($element->constraint == 'pound'){ + $main_cur = $lang['price_pound_main']; + $child_cur = $lang['price_pound_sub']; + $cur_symbol = '£'; + }elseif ($element->constraint == 'euro'){ + $main_cur = $lang['price_euro_main']; + $child_cur = $lang['price_euro_sub']; + $cur_symbol = '€'; + }else{ //dollar + $main_cur = $lang['price_dollar_main']; + $child_cur = $lang['price_dollar_sub']; + $cur_symbol = '$'; + } + +$element_markup = << + + {$cur_symbol} + + . + + + + + + + {$guidelines} {$error_message} + +EOT; + + }else{ //for yen, only display one textfield + $main_cur = $lang['price_yen']; + $cur_symbol = '¥'; + +$element_markup = << + + {$cur_symbol} + + + + + {$guidelines} {$error_message} + +EOT; + + } + + + + return $element_markup; + } + + //Section Break + function display_section($element){ + $element->guidelines = nl2br($element->guidelines); +$element_markup = << +

    {$element->title}

    +

    {$element->guidelines}

    + +EOT; + + return $element_markup; + } + + + + //Number + function display_number($element){ + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + //check for populated value, if exist, use it instead default_value + if(isset($element->populated_value['element_'.$element->id]['default_value'])){ + $element->default_value = $element->populated_value['element_'.$element->id]['default_value']; + } + +$element_markup = << + +
    + +
    {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + + + //Address + function display_address($element){ + + $country[0]['label'] = "Afghanistan"; + $country[1]['label'] = "Albania"; + $country[2]['label'] = "Algeria"; + $country[3]['label'] = "Andorra"; + $country[4]['label'] = "Antigua and Barbuda"; + $country[5]['label'] = "Argentina"; + $country[6]['label'] = "Armenia"; + $country[7]['label'] = "Australia"; + $country[8]['label'] = "Austria"; + $country[9]['label'] = "Azerbaijan"; + $country[10]['label'] = "Bahamas"; + $country[11]['label'] = "Bahrain"; + $country[12]['label'] = "Bangladesh"; + $country[13]['label'] = "Barbados"; + $country[14]['label'] = "Belarus"; + $country[15]['label'] = "Belgium"; + $country[16]['label'] = "Belize"; + $country[17]['label'] = "Benin"; + $country[18]['label'] = "Bhutan"; + $country[19]['label'] = "Bolivia"; + $country[20]['label'] = "Bosnia and Herzegovina"; + $country[21]['label'] = "Botswana"; + $country[22]['label'] = "Brazil"; + $country[23]['label'] = "Brunei"; + $country[24]['label'] = "Bulgaria"; + $country[25]['label'] = "Burkina Faso"; + $country[26]['label'] = "Burundi"; + $country[27]['label'] = "Cambodia"; + $country[28]['label'] = "Cameroon"; + $country[29]['label'] = "Canada"; + $country[30]['label'] = "Cape Verde"; + $country[31]['label'] = "Central African Republic"; + $country[32]['label'] = "Chad"; + $country[33]['label'] = "Chile"; + $country[34]['label'] = "China"; + $country[35]['label'] = "Colombia"; + $country[36]['label'] = "Comoros"; + $country[37]['label'] = "Congo"; + $country[38]['label'] = "Costa Rica"; + $country[39]['label'] = "Côte d'Ivoire"; + $country[40]['label'] = "Croatia"; + $country[41]['label'] = "Cuba"; + $country[42]['label'] = "Cyprus"; + $country[43]['label'] = "Czech Republic"; + $country[44]['label'] = "Denmark"; + $country[45]['label'] = "Djibouti"; + $country[46]['label'] = "Dominica"; + $country[47]['label'] = "Dominican Republic"; + $country[48]['label'] = "East Timor"; + $country[49]['label'] = "Ecuador"; + $country[50]['label'] = "Egypt"; + $country[51]['label'] = "El Salvador"; + $country[52]['label'] = "Equatorial Guinea"; + $country[53]['label'] = "Eritrea"; + $country[54]['label'] = "Estonia"; + $country[55]['label'] = "Ethiopia"; + $country[56]['label'] = "Fiji"; + $country[57]['label'] = "Finland"; + $country[58]['label'] = "France"; + $country[59]['label'] = "Gabon"; + $country[60]['label'] = "Gambia"; + $country[61]['label'] = "Georgia"; + $country[62]['label'] = "Germany"; + $country[63]['label'] = "Ghana"; + $country[64]['label'] = "Greece"; + $country[65]['label'] = "Grenada"; + $country[66]['label'] = "Guatemala"; + $country[67]['label'] = "Guinea"; + $country[68]['label'] = "Guinea-Bissau"; + $country[69]['label'] = "Guyana"; + $country[70]['label'] = "Haiti"; + $country[71]['label'] = "Honduras"; + $country[72]['label'] = "Hong Kong"; + $country[73]['label'] = "Hungary"; + $country[74]['label'] = "Iceland"; + $country[75]['label'] = "India"; + $country[76]['label'] = "Indonesia"; + $country[77]['label'] = "Iran"; + $country[78]['label'] = "Iraq"; + $country[79]['label'] = "Ireland"; + $country[80]['label'] = "Israel"; + $country[81]['label'] = "Italy"; + $country[82]['label'] = "Jamaica"; + $country[83]['label'] = "Japan"; + $country[84]['label'] = "Jordan"; + $country[85]['label'] = "Kazakhstan"; + $country[86]['label'] = "Kenya"; + $country[87]['label'] = "Kiribati"; + $country[88]['label'] = "North Korea"; + $country[89]['label'] = "South Korea"; + $country[90]['label'] = "Kuwait"; + $country[91]['label'] = "Kyrgyzstan"; + $country[92]['label'] = "Laos"; + $country[93]['label'] = "Latvia"; + $country[94]['label'] = "Lebanon"; + $country[95]['label'] = "Lesotho"; + $country[96]['label'] = "Liberia"; + $country[97]['label'] = "Libya"; + $country[98]['label'] = "Liechtenstein"; + $country[99]['label'] = "Lithuania"; + $country[100]['label'] = "Luxembourg"; + $country[101]['label'] = "Macedonia"; + $country[102]['label'] = "Madagascar"; + $country[103]['label'] = "Malawi"; + $country[104]['label'] = "Malaysia"; + $country[105]['label'] = "Maldives"; + $country[106]['label'] = "Mali"; + $country[107]['label'] = "Malta"; + $country[108]['label'] = "Marshall Islands"; + $country[109]['label'] = "Mauritania"; + $country[110]['label'] = "Mauritius"; + $country[111]['label'] = "Mexico"; + $country[112]['label'] = "Micronesia"; + $country[113]['label'] = "Moldova"; + $country[114]['label'] = "Monaco"; + $country[115]['label'] = "Mongolia"; + $country[116]['label'] = "Montenegro"; + $country[117]['label'] = "Morocco"; + $country[118]['label'] = "Mozambique"; + $country[119]['label'] = "Myanmar"; + $country[120]['label'] = "Namibia"; + $country[121]['label'] = "Nauru"; + $country[122]['label'] = "Nepal"; + $country[123]['label'] = "Netherlands"; + $country[124]['label'] = "New Zealand"; + $country[125]['label'] = "Nicaragua"; + $country[126]['label'] = "Niger"; + $country[127]['label'] = "Nigeria"; + $country[128]['label'] = "Norway"; + $country[129]['label'] = "Oman"; + $country[130]['label'] = "Pakistan"; + $country[131]['label'] = "Palau"; + $country[132]['label'] = "Panama"; + $country[133]['label'] = "Papua New Guinea"; + $country[134]['label'] = "Paraguay"; + $country[135]['label'] = "Peru"; + $country[136]['label'] = "Philippines"; + $country[137]['label'] = "Poland"; + $country[138]['label'] = "Portugal"; + $country[139]['label'] = "Puerto Rico"; + $country[140]['label'] = "Qatar"; + $country[141]['label'] = "Romania"; + $country[142]['label'] = "Russia"; + $country[143]['label'] = "Rwanda"; + $country[144]['label'] = "Saint Kitts and Nevis"; + $country[145]['label'] = "Saint Lucia"; + $country[146]['label'] = "Saint Vincent and the Grenadines"; + $country[147]['label'] = "Samoa"; + $country[148]['label'] = "San Marino"; + $country[149]['label'] = "Sao Tome and Principe"; + $country[150]['label'] = "Saudi Arabia"; + $country[151]['label'] = "Senegal"; + $country[152]['label'] = "Serbia and Montenegro"; + $country[153]['label'] = "Seychelles"; + $country[154]['label'] = "Sierra Leone"; + $country[155]['label'] = "Singapore"; + $country[156]['label'] = "Slovakia"; + $country[157]['label'] = "Slovenia"; + $country[158]['label'] = "Solomon Islands"; + $country[159]['label'] = "Somalia"; + $country[160]['label'] = "South Africa"; + $country[161]['label'] = "Spain"; + $country[162]['label'] = "Sri Lanka"; + $country[163]['label'] = "Sudan"; + $country[164]['label'] = "Suriname"; + $country[165]['label'] = "Swaziland"; + $country[166]['label'] = "Sweden"; + $country[167]['label'] = "Switzerland"; + $country[168]['label'] = "Syria"; + $country[169]['label'] = "Taiwan"; + $country[170]['label'] = "Tajikistan"; + $country[171]['label'] = "Tanzania"; + $country[172]['label'] = "Thailand"; + $country[173]['label'] = "Togo"; + $country[174]['label'] = "Tonga"; + $country[175]['label'] = "Trinidad and Tobago"; + $country[176]['label'] = "Tunisia"; + $country[177]['label'] = "Turkey"; + $country[178]['label'] = "Turkmenistan"; + $country[179]['label'] = "Tuvalu"; + $country[180]['label'] = "Uganda"; + $country[181]['label'] = "Ukraine"; + $country[182]['label'] = "United Arab Emirates"; + $country[183]['label'] = "United Kingdom"; + $country[184]['label'] = "United States"; + $country[185]['label'] = "Uruguay"; + $country[186]['label'] = "Uzbekistan"; + $country[187]['label'] = "Vanuatu"; + $country[188]['label'] = "Vatican City"; + $country[189]['label'] = "Venezuela"; + $country[190]['label'] = "Vietnam"; + $country[191]['label'] = "Yemen"; + $country[192]['label'] = "Zambia"; + $country[193]['label'] = "Zimbabwe"; + + + $country[0]['value'] = "Afghanistan"; + $country[1]['value'] = "Albania"; + $country[2]['value'] = "Algeria"; + $country[3]['value'] = "Andorra"; + $country[4]['value'] = "Antigua and Barbuda"; + $country[5]['value'] = "Argentina"; + $country[6]['value'] = "Armenia"; + $country[7]['value'] = "Australia"; + $country[8]['value'] = "Austria"; + $country[9]['value'] = "Azerbaijan"; + $country[10]['value'] = "Bahamas"; + $country[11]['value'] = "Bahrain"; + $country[12]['value'] = "Bangladesh"; + $country[13]['value'] = "Barbados"; + $country[14]['value'] = "Belarus"; + $country[15]['value'] = "Belgium"; + $country[16]['value'] = "Belize"; + $country[17]['value'] = "Benin"; + $country[18]['value'] = "Bhutan"; + $country[19]['value'] = "Bolivia"; + $country[20]['value'] = "Bosnia and Herzegovina"; + $country[21]['value'] = "Botswana"; + $country[22]['value'] = "Brazil"; + $country[23]['value'] = "Brunei"; + $country[24]['value'] = "Bulgaria"; + $country[25]['value'] = "Burkina Faso"; + $country[26]['value'] = "Burundi"; + $country[27]['value'] = "Cambodia"; + $country[28]['value'] = "Cameroon"; + $country[29]['value'] = "Canada"; + $country[30]['value'] = "Cape Verde"; + $country[31]['value'] = "Central African Republic"; + $country[32]['value'] = "Chad"; + $country[33]['value'] = "Chile"; + $country[34]['value'] = "China"; + $country[35]['value'] = "Colombia"; + $country[36]['value'] = "Comoros"; + $country[37]['value'] = "Congo"; + $country[38]['value'] = "Costa Rica"; + $country[39]['value'] = "Côte d'Ivoire"; + $country[40]['value'] = "Croatia"; + $country[41]['value'] = "Cuba"; + $country[42]['value'] = "Cyprus"; + $country[43]['value'] = "Czech Republic"; + $country[44]['value'] = "Denmark"; + $country[45]['value'] = "Djibouti"; + $country[46]['value'] = "Dominica"; + $country[47]['value'] = "Dominican Republic"; + $country[48]['value'] = "East Timor"; + $country[49]['value'] = "Ecuador"; + $country[50]['value'] = "Egypt"; + $country[51]['value'] = "El Salvador"; + $country[52]['value'] = "Equatorial Guinea"; + $country[53]['value'] = "Eritrea"; + $country[54]['value'] = "Estonia"; + $country[55]['value'] = "Ethiopia"; + $country[56]['value'] = "Fiji"; + $country[57]['value'] = "Finland"; + $country[58]['value'] = "France"; + $country[59]['value'] = "Gabon"; + $country[60]['value'] = "Gambia"; + $country[61]['value'] = "Georgia"; + $country[62]['value'] = "Germany"; + $country[63]['value'] = "Ghana"; + $country[64]['value'] = "Greece"; + $country[65]['value'] = "Grenada"; + $country[66]['value'] = "Guatemala"; + $country[67]['value'] = "Guinea"; + $country[68]['value'] = "Guinea-Bissau"; + $country[69]['value'] = "Guyana"; + $country[70]['value'] = "Haiti"; + $country[71]['value'] = "Honduras"; + $country[72]['value'] = "Hong Kong"; + $country[73]['value'] = "Hungary"; + $country[74]['value'] = "Iceland"; + $country[75]['value'] = "India"; + $country[76]['value'] = "Indonesia"; + $country[77]['value'] = "Iran"; + $country[78]['value'] = "Iraq"; + $country[79]['value'] = "Ireland"; + $country[80]['value'] = "Israel"; + $country[81]['value'] = "Italy"; + $country[82]['value'] = "Jamaica"; + $country[83]['value'] = "Japan"; + $country[84]['value'] = "Jordan"; + $country[85]['value'] = "Kazakhstan"; + $country[86]['value'] = "Kenya"; + $country[87]['value'] = "Kiribati"; + $country[88]['value'] = "North Korea"; + $country[89]['value'] = "South Korea"; + $country[90]['value'] = "Kuwait"; + $country[91]['value'] = "Kyrgyzstan"; + $country[92]['value'] = "Laos"; + $country[93]['value'] = "Latvia"; + $country[94]['value'] = "Lebanon"; + $country[95]['value'] = "Lesotho"; + $country[96]['value'] = "Liberia"; + $country[97]['value'] = "Libya"; + $country[98]['value'] = "Liechtenstein"; + $country[99]['value'] = "Lithuania"; + $country[100]['value'] = "Luxembourg"; + $country[101]['value'] = "Macedonia"; + $country[102]['value'] = "Madagascar"; + $country[103]['value'] = "Malawi"; + $country[104]['value'] = "Malaysia"; + $country[105]['value'] = "Maldives"; + $country[106]['value'] = "Mali"; + $country[107]['value'] = "Malta"; + $country[108]['value'] = "Marshall Islands"; + $country[109]['value'] = "Mauritania"; + $country[110]['value'] = "Mauritius"; + $country[111]['value'] = "Mexico"; + $country[112]['value'] = "Micronesia"; + $country[113]['value'] = "Moldova"; + $country[114]['value'] = "Monaco"; + $country[115]['value'] = "Mongolia"; + $country[116]['value'] = "Montenegro"; + $country[117]['value'] = "Morocco"; + $country[118]['value'] = "Mozambique"; + $country[119]['value'] = "Myanmar"; + $country[120]['value'] = "Namibia"; + $country[121]['value'] = "Nauru"; + $country[122]['value'] = "Nepal"; + $country[123]['value'] = "Netherlands"; + $country[124]['value'] = "New Zealand"; + $country[125]['value'] = "Nicaragua"; + $country[126]['value'] = "Niger"; + $country[127]['value'] = "Nigeria"; + $country[128]['value'] = "Norway"; + $country[129]['value'] = "Oman"; + $country[130]['value'] = "Pakistan"; + $country[131]['value'] = "Palau"; + $country[132]['value'] = "Panama"; + $country[133]['value'] = "Papua New Guinea"; + $country[134]['value'] = "Paraguay"; + $country[135]['value'] = "Peru"; + $country[136]['value'] = "Philippines"; + $country[137]['value'] = "Poland"; + $country[138]['value'] = "Portugal"; + $country[139]['value'] = "Puerto Rico"; + $country[140]['value'] = "Qatar"; + $country[141]['value'] = "Romania"; + $country[142]['value'] = "Russia"; + $country[143]['value'] = "Rwanda"; + $country[144]['value'] = "Saint Kitts and Nevis"; + $country[145]['value'] = "Saint Lucia"; + $country[146]['value'] = "Saint Vincent and the Grenadines"; + $country[147]['value'] = "Samoa"; + $country[148]['value'] = "San Marino"; + $country[149]['value'] = "Sao Tome and Principe"; + $country[150]['value'] = "Saudi Arabia"; + $country[151]['value'] = "Senegal"; + $country[152]['value'] = "Serbia and Montenegro"; + $country[153]['value'] = "Seychelles"; + $country[154]['value'] = "Sierra Leone"; + $country[155]['value'] = "Singapore"; + $country[156]['value'] = "Slovakia"; + $country[157]['value'] = "Slovenia"; + $country[158]['value'] = "Solomon Islands"; + $country[159]['value'] = "Somalia"; + $country[160]['value'] = "South Africa"; + $country[161]['value'] = "Spain"; + $country[162]['value'] = "Sri Lanka"; + $country[163]['value'] = "Sudan"; + $country[164]['value'] = "Suriname"; + $country[165]['value'] = "Swaziland"; + $country[166]['value'] = "Sweden"; + $country[167]['value'] = "Switzerland"; + $country[168]['value'] = "Syria"; + $country[169]['value'] = "Taiwan"; + $country[170]['value'] = "Tajikistan"; + $country[171]['value'] = "Tanzania"; + $country[172]['value'] = "Thailand"; + $country[173]['value'] = "Togo"; + $country[174]['value'] = "Tonga"; + $country[175]['value'] = "Trinidad and Tobago"; + $country[176]['value'] = "Tunisia"; + $country[177]['value'] = "Turkey"; + $country[178]['value'] = "Turkmenistan"; + $country[179]['value'] = "Tuvalu"; + $country[180]['value'] = "Uganda"; + $country[181]['value'] = "Ukraine"; + $country[182]['value'] = "United Arab Emirates"; + $country[183]['value'] = "United Kingdom"; + $country[184]['value'] = "United States"; + $country[185]['value'] = "Uruguay"; + $country[186]['value'] = "Uzbekistan"; + $country[187]['value'] = "Vanuatu"; + $country[188]['value'] = "Vatican City"; + $country[189]['value'] = "Venezuela"; + $country[190]['value'] = "Vietnam"; + $country[191]['value'] = "Yemen"; + $country[192]['value'] = "Zambia"; + $country[193]['value'] = "Zimbabwe"; + + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + global $lang; + + if(!empty($element->is_error)){ + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + //check for required + if($element->is_required){ + $span_required = "id}\" class=\"required\">*"; + } + + //check for guidelines + if(!empty($element->guidelines)){ + $guidelines = "

    id}\">{$element->guidelines}

    "; + } + + + //create country markup, if no default value, provide a blank option + if(empty($element->default_value)){ + $country_markup = ''."\n"; + }else{ + $country_markup = ''; + } + + foreach ($country as $data){ + if($data['value'] == $element->default_value){ + $selected = 'selected="selected"'; + }else{ + $selected = ''; + } + + //check for populated value, use it instead of default value + if(!empty($element->populated_value['element_'.$element->id.'_6']['default_value'])){ + $selected = ''; + if($element->populated_value['element_'.$element->id.'_6']['default_value'] == $data['value']){ + $selected = 'selected="selected"'; + } + } + + $country_markup .= "\n"; + } + +$element_markup = << + + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
    + +
    + + +
     {$guidelines} {$error_message} + +EOT; + + + return $element_markup; + } + + + //Captcha + function display_captcha($element){ + + if(!empty($element->error_message)){ + $error_code = $element->error_message; + }else{ + $error_code = ''; + } + + //check for error + $error_class = ''; + $error_message = ''; + $span_required = ''; + $guidelines = ''; + global $lang; + + if(!empty($element->is_error)){ + + if($element->error_message == 'el-required'){ + $element->error_message = $lang['captcha_required']; + $error_code = ''; + }elseif ($element->error_message == 'incorrect-captcha-sol'){ + $element->error_message = $lang['captcha_mismatch']; + }else{ + $element->error_message = "{$lang['captcha_error']} ({$element->error_message})"; + } + + $error_class = 'class="error"'; + $error_message = "

    {$element->error_message}

    "; + } + + if(!empty($_SERVER['HTTPS'])){ + $use_ssl = true; + }else{ + $use_ssl = false; + } + + + if(USE_INTERNAL_CAPTCHA === true){ //use the internal captcha if enabled + + $machform_path = ''; + if(!empty($element->machform_path)){ + $machform_path = $element->machform_path; + } + + $timestamp = time(); //use this as paramater for captcha.php, to prevent caching + + $element->title = $lang['captcha_title']; +$captcha_html = <<
    +
    +EOT; + + }else{ //otherwise use the reCAPTCHA + $captcha_html = recaptcha_get_html(RECAPTCHA_PUBLIC_KEY, $error_code,$use_ssl); + + if($captcha_html === false){ + $domain = str_replace('www.','',$_SERVER['SERVER_NAME']); + $captcha_html = "Error! You have enabled CAPTCHA but no API key available.

    To use CAPTCHA you must get an API key from http://recaptcha.net/api/getkey

    After getting the API key, save them into your config.php file."; + $error_class = 'class="error"'; + } + } + + + if(function_exists("form{$element->form_id}_hook_pre_captcha")){ + $custom_precaptcha = call_user_func("form{$element->form_id}_hook_pre_captcha"); + } + +$element_markup = << {$custom_precaptcha} + +
    + {$captcha_html} +
    + {$guidelines} {$error_message} + +EOT; + + return $element_markup; + } + + + //Main function to display a form + //There are few mode when displaying a form + //1. New blank form (form populated with default values) + //2. New form with error (displayed when 1 submitted and having error, form populated with user inputs) + //3. Edit form (form populated with data from db) + //4. Edit form with error (displayed when 3 submiteed and having error) + function display_form($form_id,$populated_values=array(),$error_elements=array(),$custom_error='',$edit_id=0,$embed=false){ + + global $lang; + + //if there is custom error, don't show other errors + if(!empty($custom_error)){ + $error_elements = array(); + } + + //get form properties data + $query = "select + form_name, + form_description, + form_redirect, + form_success_message, + form_password, + form_unique_ip, + form_frame_height, + form_has_css, + form_active, + form_captcha, + form_review + from + ap_forms + where + form_id='$form_id'"; + $result = do_query($query); + $row = do_fetch_result($result); + + $form = new \stdClass(); + + $form->id = $form_id; + $form->name = $row['form_name']; + $form->description = $row['form_description']; + $form->redirect = $row['form_redirect']; + $form->success_message = $row['form_success_message']; + $form->password = $row['form_password']; + $form->frame_height = $row['form_frame_height']; + $form->unique_ip = $row['form_unique_ip']; + $form->has_css = $row['form_has_css']; + $form->active = $row['form_active']; + $form->captcha = $row['form_captcha']; + $form->review = $row['form_review']; + + if(empty($error_elements)){ + $form->is_error = 0; + }else{ + $form->is_error = 1; + } + + //if this form has review enabled and user are having $_SESSION['review_id'], then populate the form with that values + if(!empty($form->review) && !empty($_SESSION['review_id']) && empty($populated_values)){ + $populated_values = get_entry_values($form_id,$_SESSION['review_id'],true); + } + + //get elements data + //get element options first and store it into array + $query = "select + element_id, + option_id, + `position`, + `option`, + option_is_default + from + ap_element_options + where + form_id='$form_id' and live=1 + order by + element_id asc,`position` asc"; + $result = do_query($query); + while($row = do_fetch_result($result)){ + $element_id = $row['element_id']; + $option_id = $row['option_id']; + $options_lookup[$element_id][$option_id]['position'] = $row['position']; + $options_lookup[$element_id][$option_id]['option'] = $row['option']; + $options_lookup[$element_id][$option_id]['option_is_default'] = $row['option_is_default']; + } + + + //get elements data + $element = array(); + $query = "select + element_id, + element_title, + element_guidelines, + element_size, + element_is_required, + element_is_unique, + element_is_private, + element_type, + element_position, + element_default_value, + element_constraint + from + ap_form_elements + where + form_id='$form_id' + order by + element_position asc"; + $result = do_query($query); + + $j=0; + $has_calendar = false; //assume the form doesn't have calendar, so it won't load calendar.js + while($row = do_fetch_result($result)){ + $element_id = $row['element_id']; + + //lookup element options first + if(!empty($options_lookup[$element_id])){ + $element_options = array(); + $i=0; + foreach ($options_lookup[$element_id] as $option_id=>$data){ + $element_options[$i] = new \stdClass(); + $element_options[$i]->id = $option_id; + $element_options[$i]->option = $data['option']; + $element_options[$i]->is_default = $data['option_is_default']; + $element_options[$i]->is_db_live = 1; + $i++; + } + } + + + //populate elements + $element[$j] = new \stdClass(); + $element[$j]->title = nl2br($row['element_title']); + $element[$j]->guidelines = $row['element_guidelines']; + $element[$j]->size = $row['element_size']; + $element[$j]->is_required = $row['element_is_required']; + $element[$j]->is_unique = $row['element_is_unique']; + $element[$j]->is_private = $row['element_is_private']; + $element[$j]->type = $row['element_type']; + $element[$j]->position = $row['element_position']; + $element[$j]->id = $row['element_id']; + $element[$j]->is_db_live = 1; + + //this data came from db or form submit + //being used to display edit form or redisplay form with errors and previous inputs + //this should be optimized in the future, only pass necessary data, not the whole array + $element[$j]->populated_value = $populated_values; + + //if there is file upload type, set form enctype to multipart + if($row['element_type'] == 'file'){ + $form_enc_type = 'enctype="multipart/form-data"'; + } + + if(!empty($error_elements[$element[$j]->id])){ + $element[$j]->is_error = 1; + $element[$j]->error_message = $error_elements[$element[$j]->id]; + } + + + $element[$j]->default_value = htmlspecialchars($row['element_default_value']); + + + $element[$j]->constraint = $row['element_constraint']; + if(!empty($element_options)){ + $element[$j]->options = $element_options; + }else{ + $element[$j]->options = ''; + } + + + //check for calendar type + if($row['element_type'] == 'date' || $row['element_type'] == 'europe_date'){ + $has_calendar = true; + } + + $j++; + } + + + //add captcha if enable + if(!empty($form->captcha) && (empty($edit_id))){ + $element[$j] = new \stdClass(); + $element[$j]->type = 'captcha'; + $element[$j]->form_id = $form_id; + $element[$j]->is_private = 0; + + if(!empty($error_elements['element_captcha'])){ + $element[$j]->is_error = 1; + $element[$j]->error_message = $error_elements['element_captcha']; + } + } + + //generate html markup for each element + $all_element_markup = ''; + foreach ($element as $element_data){ + if($element_data->is_private && empty($_SESSION['logged_in'])){ //don't show private element + continue; + } + $all_element_markup .= call_user_func(__NAMESPACE__ .'\display_'.$element_data->type,$element_data); + } + + if(!empty($custom_error)){ + $form->error_message =<< +

    {$custom_error}

    + +EOT; + }elseif(!empty($error_elements)){ + $form->error_message =<< +

    {$lang['error_title']}

    +

    {$lang['error_desc']}

    + +EOT; + } + + + //display edit_id if there is any + if(!empty($edit_id)){ + $edit_markup = "\n"; + }else{ + $edit_markup = ''; + } + + if(empty($form->review)){ + $button_text = $lang['submit_button']; + }else{ + $button_text = $lang['continue_button']; + } + + //markup for submit button + $button_markup =<< + + {$edit_markup} + + + +EOT; + + //check for specific form css, if any, use it instead + if($form->has_css){ + $css_dir = DATA_DIR."/form_{$form_id}/css/"; + } + + if(!empty($form->password) && empty($_SESSION['user_authenticated'])){ //if form require password and password hasn't set yet + $show_password_form = true; + + }elseif (!empty($form->password) && !empty($_SESSION['user_authenticated']) && $_SESSION['user_authenticated'] != $form_id){ //if user authenticated but not for this form + $show_password_form = true; + + }else{ //user authenticated for this form, or no password required + $show_password_form = false; + } + + + if(empty($form->active)){ //if form is not active, don't show the fields + $form_desc_div =''; + $all_element_markup = ''; + $button_markup = ''; + $ul_class = 'class="password"'; + $custom_element =<< +

    {$lang['form_inactive']}

    + +EOT; + }elseif($show_password_form){ //don't show form description if this page is password protected and user not authenticated + $form_desc_div =''; + $all_element_markup = ''; + $custom_element =<< +

    {$lang['form_pass_title']}

    +
    + + +
    + +EOT; + $ul_class = 'class="password"'; + }else{ + if(!empty($form->name) || !empty($form->description)){ + $form->description = nl2br($form->description); + $form_desc_div =<< +

    {$form->name}

    +

    {$form->description}

    + +EOT; + } + } + + if($embed){ + $embed_class = 'class="embed"'; + } + + if($has_calendar){ + $calendar_js = ''; + }else{ + $calendar_js = ''; + } + + + //If you would like to remove the "Powered by MachForm" link, please contact us at customer.service@appnitro.com before doing so + $form_markup = << + + + +{$form->name} + + +{$calendar_js} + + + + + + +
    + +

    {$form->name}

    +{$soy_un_movil} +
    + {$form_desc_div} +
      + {$form->error_message} + {$all_element_markup} + {$custom_element} + {$button_markup} +
    +
    + +
    + + + +EOT; + return $form_markup; + + } + + //this function is similar as display_form, but designed to display form without IFRAME + function display_integrated_form($form_id,$populated_values=array(),$error_elements=array(),$custom_error='',$edit_id=0,$machform_path){ + + global $lang; + + //if there is custom error, don't show other errors + if(!empty($custom_error)){ + $error_elements = array(); + } + + //get form properties data + $query = "select + form_name, + form_description, + form_redirect, + form_success_message, + form_password, + form_unique_ip, + form_frame_height, + form_has_css, + form_active, + form_captcha, + form_review + from + ap_forms + where + form_id='$form_id'"; + $result = do_query($query); + $row = do_fetch_result($result); + + $form = new stdClass(); + + $form->id = $form_id; + $form->name = $row['form_name']; + $form->description = $row['form_description']; + $form->redirect = $row['form_redirect']; + $form->success_message = $row['form_success_message']; + $form->password = $row['form_password']; + $form->frame_height = $row['form_frame_height']; + $form->unique_ip = $row['form_unique_ip']; + $form->has_css = $row['form_has_css']; + $form->active = $row['form_active']; + $form->captcha = $row['form_captcha']; + $form->review = $row['form_review']; + + if(empty($error_elements)){ + $form->is_error = 0; + }else{ + $form->is_error = 1; + } + + //if this form has review enabled and user are having $_SESSION['review_id'], then populate the form with that values + if(!empty($form->review) && !empty($_SESSION['review_id']) && empty($populated_values)){ + $param['machform_path'] = $machform_path; + $populated_values = get_entry_values($form_id,$_SESSION['review_id'],true,$param); + } + + //get elements data + //get element options first and store it into array + $query = "select + element_id, + option_id, + `position`, + `option`, + option_is_default + from + ap_element_options + where + form_id='$form_id' and live=1 + order by + element_id asc,`position` asc"; + $result = do_query($query); + while($row = do_fetch_result($result)){ + $element_id = $row['element_id']; + $option_id = $row['option_id']; + $options_lookup[$element_id][$option_id]['position'] = $row['position']; + $options_lookup[$element_id][$option_id]['option'] = $row['option']; + $options_lookup[$element_id][$option_id]['option_is_default'] = $row['option_is_default']; + } + + + //get elements data + $element = array(); + $query = "select + element_id, + element_title, + element_guidelines, + element_size, + element_is_required, + element_is_unique, + element_is_private, + element_type, + element_position, + element_default_value, + element_constraint + from + ap_form_elements + where + form_id='$form_id' + order by + element_position asc"; + $result = do_query($query); + + $j=0; + $has_calendar = false; + while($row = do_fetch_result($result)){ + $element_id = $row['element_id']; + + //lookup element options first + if(!empty($options_lookup[$element_id])){ + $element_options = array(); + $i=0; + foreach ($options_lookup[$element_id] as $option_id=>$data){ + $element_options[$i] = new stdClass(); + $element_options[$i]->id = $option_id; + $element_options[$i]->option = $data['option']; + $element_options[$i]->is_default = $data['option_is_default']; + $element_options[$i]->is_db_live = 1; + $i++; + } + } + + + //populate elements + $element[$j] = new stdClass(); + $element[$j]->title = nl2br($row['element_title']); + + if(empty($edit_id)){ + $element[$j]->guidelines = $row['element_guidelines']; + }else{ + $element[$j]->guidelines = ''; + } + + $element[$j]->size = $row['element_size']; + $element[$j]->is_required = $row['element_is_required']; + $element[$j]->is_unique = $row['element_is_unique']; + $element[$j]->is_private = $row['element_is_private']; + $element[$j]->type = $row['element_type']; + $element[$j]->position = $row['element_position']; + $element[$j]->id = $row['element_id']; + $element[$j]->is_db_live = 1; + $element[$j]->machform_path = $machform_path; + + //this data came from db or form submit + //being used to display edit form or redisplay form with errors and previous inputs + //this should be optimized in the future, only pass necessary data, not the whole array + $element[$j]->populated_value = $populated_values; + + //if there is file upload type, set form enctype to multipart + if($row['element_type'] == 'file'){ + $form_enc_type = 'enctype="multipart/form-data"'; + } + + if(!empty($error_elements[$element[$j]->id])){ + $element[$j]->is_error = 1; + $element[$j]->error_message = $error_elements[$element[$j]->id]; + } + + + $element[$j]->default_value = htmlspecialchars($row['element_default_value']); + + + $element[$j]->constraint = $row['element_constraint']; + if(!empty($element_options)){ + $element[$j]->options = $element_options; + }else{ + $element[$j]->options = ''; + } + + //check for calendar type + if($row['element_type'] == 'date' || $row['element_type'] == 'europe_date'){ + $has_calendar = true; + } + + $j++; + } + + + //add captcha if enable + if(!empty($form->captcha) && (empty($edit_id))){ + $element[$j] = new stdClass(); + $element[$j]->type = 'captcha'; + $element[$j]->form_id = $form_id; + $element[$j]->machform_path = $machform_path; + + if(!empty($error_elements['element_captcha'])){ + $element[$j]->is_error = 1; + $element[$j]->error_message = $error_elements['element_captcha']; + } + } + + //generate html markup for each element + $all_element_markup = ''; + foreach ($element as $element_data){ + if($element_data->is_private && empty($_SESSION['logged_in'])){ //don't show private element + continue; + } + $all_element_markup .= call_user_func('display_'.$element_data->type,$element_data); + } + + if(!empty($custom_error)){ + $form->error_message =<< +

    {$custom_error}

    + +EOT; + }elseif(!empty($error_elements)){ + $form->error_message =<< +

    {$lang['error_title']}

    +

    {$lang['error_desc']}

    + +EOT; + } + + if(!empty($form->password) && empty($_SESSION['user_authenticated'])){ //if form require password and password hasn't set yet + $show_password_form = true; + + }elseif (!empty($form->password) && !empty($_SESSION['user_authenticated']) && $_SESSION['user_authenticated'] != $form_id){ //if user authenticated but not for this form + $show_password_form = true; + + }else{ //user authenticated for this form, or no password required + $show_password_form = false; + } + + //display edit_id if there is any + if(!empty($edit_id)){ + $edit_markup = "\n"; + $submit_button = ''; + }else{ + $edit_markup = ''; + + if(!empty($form->review) && !$show_password_form){ + $submit_button = ''."\n".''; + }else{ + $submit_button = ''."\n".''; + } + } + + + //markup for submit button + $button_markup =<< + + {$edit_markup} + {$submit_button} + +EOT; + + //check for specific form css, if any, use it instead + if($form->has_css){ + $css_dir = DATA_DIR."/form_{$form_id}/css/"; + } + + + if(empty($form->active)){ //if form is not active, don't show the fields + $form_desc_div =''; + $all_element_markup = ''; + $button_markup = ''; + $ul_class = 'class="password"'; + $custom_element =<< +

    {$lang['form_inactive']}

    + +EOT; + }elseif($show_password_form){ //don't show form description if this page is password protected and user not authenticated + $form_desc_div =''; + $all_element_markup = ''; + $custom_element =<< +

    {$lang['form_pass_title']}

    +
    + + +
    + +EOT; + $ul_class = 'class="password"'; + }else{ + if(!empty($form->name) || !empty($form->description)){ + $form->description = nl2br($form->description); + $form_desc_div =<< +

    {$form->name}

    +

    {$form->description}

    + +EOT; + } + } + + + $embed_class = 'class="integrated"'; + + if(empty($edit_id)){ + $css_markup = ""; + }else{ + $css_markup = ""; + } + + if($has_calendar){ + $calendar_js = ""; + }else{ + $calendar_js = ''; + } + + + //If you would like to remove the "Powered by MachForm" link, please contact us at customer.service@appnitro.com before doing so + $form_markup =<< +{$calendar_js} + +
    + +
    + +

    {$form->name}

    +
    + {$form_desc_div} +
      + {$form->error_message} + {$all_element_markup} + {$custom_element} + {$button_markup} +
    +
    + +
    +
    +EOT; + return $form_markup; + + } + + function display_success($form_id,$embed=false){ + //get form properties data + $query = "select + form_success_message, + form_has_css, + form_name + from + ap_forms + where + form_id='$form_id'"; + + $result = do_query($query); + $row = do_fetch_result($result); + + $form = new stdClass(); + + $form->id = $form_id; + $form->success_message = nl2br($row['form_success_message']); + $form->has_css = $row['form_has_css']; + $form->name = $row['form_name']; + + + //check for specific form css, if any, use it instead + if($form->has_css){ + $css_dir = DATA_DIR."/form_{$form_id}/css/"; + } + + if($embed){ + $embed_class = 'class="embed"'; + } + + $form_markup = << + + + +{$form->name} + + + + + +
    + +

    Appnitro MachForm

    + +
    +

    {$form->success_message}

    +
    + +
    + + + +EOT; + return $form_markup; + } + + //this function is similar as display_success, but designed to display success page without IFRAME + function display_integrated_success($form_id,$machform_path){ + //get form properties data + $query = "select + form_success_message, + form_has_css + from + ap_forms + where + form_id='$form_id'"; + + $result = do_query($query); + $row = do_fetch_result($result); + + $form = new stdClass(); + + $form->id = $form_id; + $form->success_message = nl2br($row['form_success_message']); + $form->has_css = $row['form_has_css']; + + + //check for specific form css, if any, use it instead + if($form->has_css){ + $css_dir = DATA_DIR."/form_{$form_id}/css/"; + } + + + $form_markup = << +
    +
    +

    Appnitro MachForm

    + +
    +

    {$form->success_message}

    +
    + +
    +
    +EOT; + return $form_markup; + } + + //display form confirmation page + function display_form_review($form_id,$record_id,$embed=false){ + global $lang; + + //get form properties data + $query = "select + form_has_css, + form_redirect + from + ap_forms + where + form_id='$form_id'"; + + $result = do_query($query); + $row = do_fetch_result($result); + + + $form_has_css = $row['form_has_css']; + $form_redirect = $row['form_redirect']; + + //prepare entry data for previewing + $param['strip_download_link'] = true; + $param['review_mode'] = true; + $param['show_attach_image'] = true; + $entry_details = get_entry_details($form_id,$record_id,$param); + + $entry_data = ''."\n"; + + $toggle = false; + foreach ($entry_details as $data){ + if($toggle){ + $toggle = false; + $row_style = 'class="alt"'; + }else{ + $toggle = true; + $row_style = ''; + } + + $entry_data .= "\n"; + $entry_data .= "\n"; + $entry_data .= "\n"; + $entry_data .= "\n"; + } + + $entry_data .= '
    {$data['label']}".nl2br($data['value'])."
    '; + + //check for specific form css, if any, use it instead + if($form_has_css){ + $css_dir = DATA_DIR."/form_{$form_id}/css/"; + } + + if($embed){ + $embed_class = 'class="embed"'; + } + + $form_markup = << + + + +{$form_name} + + + + + + + + +
    + +

    Appnitro MachForm

    +
    +
    +

    {$lang['review_title']}

    +

    {$lang['review_message']}

    +
    + {$entry_data} +
      +
    • + + + +
    • +
    +
    + +
    + + + +EOT; + return $form_markup; + } + + //display form confirmation page for integrated embed code + function display_integrated_form_review($form_id,$record_id,$machform_path){ + global $lang; + + //get form properties data + $query = "select + form_has_css, + form_redirect + from + ap_forms + where + form_id='$form_id'"; + + $result = do_query($query); + $row = do_fetch_result($result); + + + $form_has_css = $row['form_has_css']; + $form_redirect = $row['form_redirect']; + + //prepare entry data for previewing + $param['strip_download_link'] = true; + $param['review_mode'] = true; + $param['show_attach_image'] = true; + $param['machform_path'] = $machform_path; + $entry_details = get_entry_details($form_id,$record_id,$param); + + $entry_data = ''."\n"; + + $toggle = false; + foreach ($entry_details as $data){ + if($toggle){ + $toggle = false; + $row_style = 'class="alt"'; + }else{ + $toggle = true; + $row_style = ''; + } + + $entry_data .= "\n"; + $entry_data .= "\n"; + $entry_data .= "\n"; + $entry_data .= "\n"; + } + + $entry_data .= '
    {$data['label']}".nl2br($data['value'])."
    '; + + //check for specific form css, if any, use it instead + if($form_has_css){ + $css_dir = DATA_DIR."/form_{$form_id}/css/"; + } + + if($embed){ + $embed_class = 'class="embed"'; + } + + $form_action = str_replace(array("&show_review=1","?show_review=1"),"",$_SERVER['REQUEST_URI']); + + $form_markup = << + + + + +
    +
    +

    Appnitro MachForm

    +
    +
    +

    {$lang['review_title']}

    +

    {$lang['review_message']}

    +
    + {$entry_data} +
      +
    • + + + +
    • +
    +
    + +
    +
    +EOT; + return $form_markup; + } +?> \ No newline at end of file diff --git a/includes/view-functions.php b/includes/view-functions.php index 1f7c9b9..80033df 100644 --- a/includes/view-functions.php +++ b/includes/view-functions.php @@ -1,2511 +1,96 @@ -is_error)){ - $error_class = 'class="error"'; - $error_message = "

    {$element->error_message}

    "; - } - - //check for required - if($element->is_required){ - $span_required = "id}\" class=\"required\">*"; - } - - //check for guidelines - if(!empty($element->guidelines)){ - $guidelines = "

    id}\">{$element->guidelines}

    "; - } - - //check for populated value, if exist, use it instead default_value - if(isset($element->populated_value['element_'.$element->id]['default_value'])){ - $element->default_value = $element->populated_value['element_'.$element->id]['default_value']; - } - - -$element_markup = << - -
    - -
    {$guidelines} {$error_message} - -EOT; - - return $element_markup; - } - - - - //Paragraph Text - function display_textarea($element){ - //check for error - $error_class = ''; - $error_message = ''; - $span_required = ''; - $guidelines = ''; - - if(!empty($element->is_error)){ - $error_class = 'class="error"'; - $error_message = "

    {$element->error_message}

    "; - } - - //check for required - if($element->is_required){ - $span_required = "id}\" class=\"required\">*"; - } - - //check for guidelines - if(!empty($element->guidelines)){ - $guidelines = "

    id}\">{$element->guidelines}

    "; - } - - //check for populated value, if exist, use it instead default_value - if(isset($element->populated_value['element_'.$element->id]['default_value'])){ - $element->default_value = $element->populated_value['element_'.$element->id]['default_value']; - } - -$element_markup = << - -
    - -
    {$guidelines} {$error_message} - -EOT; - - return $element_markup; - } - - - //File Upload - function display_file($element){ - //check for error - $error_class = ''; - $error_message = ''; - $span_required = ''; - $guidelines = ''; - - if(!empty($element->is_error)){ - $error_class = 'class="error"'; - $error_message = "

    {$element->error_message}

    "; - } - - //check for required - if($element->is_required){ - $span_required = "id}\" class=\"required\">*"; - } - - //check for guidelines - if(!empty($element->guidelines)){ - $guidelines = "

    id}\">{$element->guidelines}

    "; - } - - //check for populated value (this is being used for edit_entry.php only) - if(!empty($element->populated_value)){ - $file_option = $element->populated_value['element_'.$element->id]['default_value']; //this should be contain html markup to download or delete current file - } - -$element_markup = << - -
    - -
    {$file_option} {$guidelines} {$error_message} - -EOT; - - return $element_markup; - } - - //Website - function display_url($element){ - //check for error - $error_class = ''; - $error_message = ''; - $span_required = ''; - $guidelines = ''; - - if(!empty($element->is_error)){ - $error_class = 'class="error"'; - $error_message = "

    {$element->error_message}

    "; - } - - //check for required - if($element->is_required){ - $span_required = "id}\" class=\"required\">*"; - } - - //check for guidelines - if(!empty($element->guidelines)){ - $guidelines = "

    id}\">{$element->guidelines}

    "; - } - - //check for default value - if(empty($element->default_value)){ - $element->default_value = 'http://'; - } - - //check for populated value, if exist, use it instead default_value - if(!empty($element->populated_value['element_'.$element->id]['default_value'])){ - $element->default_value = $element->populated_value['element_'.$element->id]['default_value']; - } - -$element_markup = << - -
    - -
    {$guidelines} {$error_message} - -EOT; - - return $element_markup; - } - - //Email - function display_email($element){ - //check for error - $error_class = ''; - $error_message = ''; - $span_required = ''; - $guidelines = ''; - - if(!empty($element->is_error)){ - $error_class = 'class="error"'; - $error_message = "

    {$element->error_message}

    "; - } - - //check for required - if($element->is_required){ - $span_required = "id}\" class=\"required\">*"; - } - - //check for guidelines - if(!empty($element->guidelines)){ - $guidelines = "

    id}\">{$element->guidelines}

    "; - } - - //check for populated value, if exist, use it instead default_value - if(!empty($element->populated_value['element_'.$element->id]['default_value'])){ - $element->default_value = $element->populated_value['element_'.$element->id]['default_value']; - } - -$element_markup = << - -
    - -
    {$guidelines} {$error_message} - -EOT; - - return $element_markup; - } - - - //Phone - Extended - function display_phone($element){ - //check for error - $error_class = ''; - $error_message = ''; - $span_required = ''; - $guidelines = ''; - - if(!empty($element->is_error)){ - $error_class = 'class="error"'; - $error_message = "

    {$element->error_message}

    "; - } - - //check for required - if($element->is_required){ - $span_required = "id}\" class=\"required\">*"; - } - - //check for guidelines - if(!empty($element->guidelines)){ - $guidelines = "

    id}\">{$element->guidelines}

    "; - } - - //check default value - if(!empty($element->default_value)){ - //split into (xxx) xxx - xxxx - $default_value_1 = substr($element->default_value,0,3); - $default_value_2 = substr($element->default_value,3,3); - $default_value_3 = substr($element->default_value,6,4); - } - - if(!empty($element->populated_value['element_'.$element->id.'_1']['default_value']) || - !empty($element->populated_value['element_'.$element->id.'_2']['default_value']) || - !empty($element->populated_value['element_'.$element->id.'_3']['default_value']) - ){ - $default_value_1 = ''; - $default_value_2 = ''; - $default_value_3 = ''; - $default_value_1 = $element->populated_value['element_'.$element->id.'_1']['default_value']; - $default_value_2 = $element->populated_value['element_'.$element->id.'_2']['default_value']; - $default_value_3 = $element->populated_value['element_'.$element->id.'_3']['default_value']; - } - - -$element_markup = << - - - - - - - - - - - - - - - - {$guidelines} {$error_message} - -EOT; - - - return $element_markup; - } - - //Phone - Simple - function display_simple_phone($element){ - //check for error - $error_class = ''; - $error_message = ''; - $span_required = ''; - $guidelines = ''; - - if(!empty($element->is_error)){ - $error_class = 'class="error"'; - $error_message = "

    {$element->error_message}

    "; - } - - //check for required - if($element->is_required){ - $span_required = "id}\" class=\"required\">*"; - } - - //check for guidelines - if(!empty($element->guidelines)){ - $guidelines = "

    id}\">{$element->guidelines}

    "; - } - - //check for populated value - if(!empty($element->populated_value['element_'.$element->id]['default_value'])){ - $element->default_value = $element->populated_value['element_'.$element->id]['default_value']; - } - -$element_markup = << - -
    - -
    {$guidelines} {$error_message} - -EOT; - - return $element_markup; - } - - - - //Date - Normal - function display_date($element){ - //check for error - $error_class = ''; - $error_message = ''; - $span_required = ''; - $guidelines = ''; - global $lang; - - if(!empty($element->is_error)){ - $error_class = 'class="error"'; - $error_message = "

    {$element->error_message}

    "; - } - - //check for required - if($element->is_required){ - $span_required = "id}\" class=\"required\">*"; - } - - //check for guidelines - if(!empty($element->guidelines)){ - $guidelines = "

    id}\">{$element->guidelines}

    "; - } - - $machform_path = ''; - if(!empty($element->machform_path)){ - $machform_path = $element->machform_path; - } - - -$element_markup = << - - - / - - - - / - - - - - - - - - Pick a date. - - - {$guidelines} {$error_message} - -EOT; - - return $element_markup; - } - - //Date - Normal - function display_europe_date($element){ - //check for error - $error_class = ''; - $error_message = ''; - $span_required = ''; - $guidelines = ''; - global $lang; - - if(!empty($element->is_error)){ - $error_class = 'class="error"'; - $error_message = "

    {$element->error_message}

    "; - } - - //check for required - if($element->is_required){ - $span_required = "id}\" class=\"required\">*"; - } - - //check for guidelines - if(!empty($element->guidelines)){ - $guidelines = "

    id}\">{$element->guidelines}

    "; - } - - $machform_path = ''; - if(!empty($element->machform_path)){ - $machform_path = $element->machform_path; - } - -$element_markup = << - - - / - - - - / - - - - - - - - - Pick a date. - - - {$guidelines} {$error_message} - -EOT; - - return $element_markup; - } - - - //Multiple Choice - function display_radio($element){ - //check for error - $error_class = ''; - $error_message = ''; - $span_required = ''; - $guidelines = ''; - - if(!empty($element->is_error)){ - $error_class = 'class="error"'; - $error_message = "

    {$element->error_message}

    "; - } - - //check for required - if($element->is_required){ - $span_required = "id}\" class=\"required\">*"; - } - - //check for guidelines - if(!empty($element->guidelines)){ - $guidelines = "

    id}\">{$element->guidelines}

    "; - } - - $option_markup = ''; - - if($element->constraint == 'random'){ - $temp = $element->options; - shuffle($temp); - $element->options = $temp; - } - - foreach ($element->options as $option){ - - if($option->is_default){ - $checked = 'checked="checked"'; - }else{ - $checked = ''; - } - - //check for populated values - if(!empty($element->populated_value['element_'.$element->id]['default_value'])){ - $checked = ''; - if($element->populated_value['element_'.$element->id]['default_value'] == $option->id){ - $checked = 'checked="checked"'; - } - } - - $option_markup .= "id}_{$option->id}\" name=\"element_{$element->id}\" class=\"element radio\" type=\"radio\" value=\"{$option->id}\" {$checked} />\n"; - $option_markup .= "\n"; - } - -$element_markup = << - - - {$option_markup} - {$guidelines} {$error_message} - -EOT; - - return $element_markup; - } - - //Checkboxes - function display_checkbox($element){ - //check for error - $error_class = ''; - $error_message = ''; - $span_required = ''; - $guidelines = ''; - - if(!empty($element->is_error)){ - $error_class = 'class="error"'; - $error_message = "

    {$element->error_message}

    "; - } - - //check for required - if($element->is_required){ - $span_required = "id}\" class=\"required\">*"; - } - - //check for guidelines - if(!empty($element->guidelines)){ - $guidelines = "

    id}\">{$element->guidelines}

    "; - } - - //check for populated value first, if any exist, unselect all default value - $is_populated = false; - foreach ($element->options as $option){ - - if(!empty($element->populated_value['element_'.$element->id.'_'.$option->id]['default_value'])){ - $is_populated = true; - break; - } - } - - $option_markup = ''; - - foreach ($element->options as $option){ - if(!$is_populated){ - if($option->is_default){ - $checked = 'checked="checked"'; - }else{ - $checked = ''; - } - }else{ - - if(!empty($element->populated_value['element_'.$element->id.'_'.$option->id]['default_value'])){ - $checked = 'checked="checked"'; - }else{ - $checked = ''; - } - } - - - - $option_markup .= "id}_{$option->id}\" name=\"element_{$element->id}_{$option->id}\" class=\"element checkbox\" type=\"checkbox\" value=\"1\" {$checked} />\n"; - $option_markup .= "\n"; - } - -$element_markup = << - - - {$option_markup} - {$guidelines} {$error_message} - -EOT; - - return $element_markup; - } - - - //Dropdown - function display_select($element){ - //check for error - $error_class = ''; - $error_message = ''; - $span_required = ''; - $guidelines = ''; - - if(!empty($element->is_error)){ - $error_class = 'class="error"'; - $error_message = "

    {$element->error_message}

    "; - } - - //check for required - if($element->is_required){ - $span_required = "id}\" class=\"required\">*"; - } - - //check for guidelines - if(!empty($element->guidelines)){ - $guidelines = "

    id}\">{$element->guidelines}

    "; - } - - $option_markup = ''; - - $has_default = false; - foreach ($element->options as $option){ - - if($option->is_default){ - $selected = 'selected="selected"'; - $has_default = true; - }else{ - $selected = ''; - } - - if(!empty($element->populated_value['element_'.$element->id]['default_value'])){ - $selected = ''; - if($element->populated_value['element_'.$element->id]['default_value'] == $option->id){ - $selected = 'selected="selected"'; - } - } - - $option_markup .= "\n"; - } - - if(!$has_default){ - if(!empty($element->populated_value['element_'.$element->id]['default_value'])){ - $option_markup = ''."\n".$option_markup; - }else{ - $option_markup = ''."\n".$option_markup; - } - } - -$element_markup = << - -
    - -
    {$guidelines} {$error_message} - -EOT; - - return $element_markup; - } - - - //Name - Simple - function display_simple_name($element){ - //check for error - $error_class = ''; - $error_message = ''; - $span_required = ''; - $guidelines = ''; - global $lang; - - if(!empty($element->is_error)){ - $error_class = 'class="error"'; - $error_message = "

    {$element->error_message}

    "; - } - - //check for required - if($element->is_required){ - $span_required = "id}\" class=\"required\">*"; - } - - //check for guidelines - if(!empty($element->guidelines)){ - $guidelines = "

    id}\">{$element->guidelines}

    "; - } - -$element_markup = << - - - - - - - - - {$guidelines} {$error_message} - -EOT; - - return $element_markup; - } - - //Name - function display_name($element){ - //check for error - $error_class = ''; - $error_message = ''; - $span_required = ''; - $guidelines = ''; - global $lang; - - if(!empty($element->is_error)){ - $error_class = 'class="error"'; - $error_message = "

    {$element->error_message}

    "; - } - - //check for required - if($element->is_required){ - $span_required = "id}\" class=\"required\">*"; - } - - //check for guidelines - if(!empty($element->guidelines)){ - $guidelines = "

    id}\">{$element->guidelines}

    "; - } - -$element_markup = << - - - - - - - - - - - - - - - - - {$guidelines} {$error_message} - -EOT; - - return $element_markup; - } - - //Time - function display_time($element){ - //check for error - $error_class = ''; - $error_message = ''; - $span_required = ''; - $guidelines = ''; - global $lang; - - if(!empty($element->is_error)){ - $error_class = 'class="error"'; - $error_message = "

    {$element->error_message}

    "; - } - - //check for required - if($element->is_required){ - $span_required = "id}\" class=\"required\">*"; - } - - //check for guidelines - if(!empty($element->guidelines)){ - $guidelines = "

    id}\">{$element->guidelines}

    "; - } - - if(!empty($element->populated_value['element_'.$element->id.'_4']['default_value'])){ - if($element->populated_value['element_'.$element->id.'_4']['default_value'] == 'AM'){ - $selected_am = 'selected'; - }else{ - $selected_pm = 'selected'; - } - } - - if($element->constraint == 'show_seconds'){ - $seconds_markup =<< - - - -EOT; - $seconds_separator = ':'; - }else{ - $seconds_markup = ''; - $seconds_separator = ''; - } - -$element_markup = << - - - : - - - - {$seconds_separator} - - - {$seconds_markup} - - - - {$guidelines} {$error_message} - -EOT; - - return $element_markup; - } - - - //Price - function display_money($element){ - //check for error - $error_class = ''; - $error_message = ''; - $span_required = ''; - $guidelines = ''; - global $lang; - - if(!empty($element->is_error)){ - $error_class = 'class="error"'; - $error_message = "

    {$element->error_message}

    "; - } - - //check for required - if($element->is_required){ - $span_required = "id}\" class=\"required\">*"; - } - - //check for guidelines - if(!empty($element->guidelines)){ - $guidelines = "

    id}\">{$element->guidelines}

    "; - } - - if($element->constraint != 'yen'){ //for dollar, pound and euro - if($element->constraint == 'pound'){ - $main_cur = $lang['price_pound_main']; - $child_cur = $lang['price_pound_sub']; - $cur_symbol = '£'; - }elseif ($element->constraint == 'euro'){ - $main_cur = $lang['price_euro_main']; - $child_cur = $lang['price_euro_sub']; - $cur_symbol = '€'; - }else{ //dollar - $main_cur = $lang['price_dollar_main']; - $child_cur = $lang['price_dollar_sub']; - $cur_symbol = '$'; - } - -$element_markup = << - - {$cur_symbol} - - . - - - - - - - {$guidelines} {$error_message} - -EOT; - - }else{ //for yen, only display one textfield - $main_cur = $lang['price_yen']; - $cur_symbol = '¥'; - -$element_markup = << - - {$cur_symbol} - - - - - {$guidelines} {$error_message} - -EOT; - - } - - - - return $element_markup; - } - - //Section Break - function display_section($element){ - $element->guidelines = nl2br($element->guidelines); -$element_markup = << -

    {$element->title}

    -

    {$element->guidelines}

    - -EOT; - - return $element_markup; - } - - - - //Number - function display_number($element){ - //check for error - $error_class = ''; - $error_message = ''; - $span_required = ''; - $guidelines = ''; - - if(!empty($element->is_error)){ - $error_class = 'class="error"'; - $error_message = "

    {$element->error_message}

    "; - } - - //check for required - if($element->is_required){ - $span_required = "id}\" class=\"required\">*"; - } - - //check for guidelines - if(!empty($element->guidelines)){ - $guidelines = "

    id}\">{$element->guidelines}

    "; - } - - //check for populated value, if exist, use it instead default_value - if(isset($element->populated_value['element_'.$element->id]['default_value'])){ - $element->default_value = $element->populated_value['element_'.$element->id]['default_value']; - } - -$element_markup = << - -
    - -
    {$guidelines} {$error_message} - -EOT; - - return $element_markup; - } - - - - //Address - function display_address($element){ - - $country[0]['label'] = "Afghanistan"; - $country[1]['label'] = "Albania"; - $country[2]['label'] = "Algeria"; - $country[3]['label'] = "Andorra"; - $country[4]['label'] = "Antigua and Barbuda"; - $country[5]['label'] = "Argentina"; - $country[6]['label'] = "Armenia"; - $country[7]['label'] = "Australia"; - $country[8]['label'] = "Austria"; - $country[9]['label'] = "Azerbaijan"; - $country[10]['label'] = "Bahamas"; - $country[11]['label'] = "Bahrain"; - $country[12]['label'] = "Bangladesh"; - $country[13]['label'] = "Barbados"; - $country[14]['label'] = "Belarus"; - $country[15]['label'] = "Belgium"; - $country[16]['label'] = "Belize"; - $country[17]['label'] = "Benin"; - $country[18]['label'] = "Bhutan"; - $country[19]['label'] = "Bolivia"; - $country[20]['label'] = "Bosnia and Herzegovina"; - $country[21]['label'] = "Botswana"; - $country[22]['label'] = "Brazil"; - $country[23]['label'] = "Brunei"; - $country[24]['label'] = "Bulgaria"; - $country[25]['label'] = "Burkina Faso"; - $country[26]['label'] = "Burundi"; - $country[27]['label'] = "Cambodia"; - $country[28]['label'] = "Cameroon"; - $country[29]['label'] = "Canada"; - $country[30]['label'] = "Cape Verde"; - $country[31]['label'] = "Central African Republic"; - $country[32]['label'] = "Chad"; - $country[33]['label'] = "Chile"; - $country[34]['label'] = "China"; - $country[35]['label'] = "Colombia"; - $country[36]['label'] = "Comoros"; - $country[37]['label'] = "Congo"; - $country[38]['label'] = "Costa Rica"; - $country[39]['label'] = "Côte d'Ivoire"; - $country[40]['label'] = "Croatia"; - $country[41]['label'] = "Cuba"; - $country[42]['label'] = "Cyprus"; - $country[43]['label'] = "Czech Republic"; - $country[44]['label'] = "Denmark"; - $country[45]['label'] = "Djibouti"; - $country[46]['label'] = "Dominica"; - $country[47]['label'] = "Dominican Republic"; - $country[48]['label'] = "East Timor"; - $country[49]['label'] = "Ecuador"; - $country[50]['label'] = "Egypt"; - $country[51]['label'] = "El Salvador"; - $country[52]['label'] = "Equatorial Guinea"; - $country[53]['label'] = "Eritrea"; - $country[54]['label'] = "Estonia"; - $country[55]['label'] = "Ethiopia"; - $country[56]['label'] = "Fiji"; - $country[57]['label'] = "Finland"; - $country[58]['label'] = "France"; - $country[59]['label'] = "Gabon"; - $country[60]['label'] = "Gambia"; - $country[61]['label'] = "Georgia"; - $country[62]['label'] = "Germany"; - $country[63]['label'] = "Ghana"; - $country[64]['label'] = "Greece"; - $country[65]['label'] = "Grenada"; - $country[66]['label'] = "Guatemala"; - $country[67]['label'] = "Guinea"; - $country[68]['label'] = "Guinea-Bissau"; - $country[69]['label'] = "Guyana"; - $country[70]['label'] = "Haiti"; - $country[71]['label'] = "Honduras"; - $country[72]['label'] = "Hong Kong"; - $country[73]['label'] = "Hungary"; - $country[74]['label'] = "Iceland"; - $country[75]['label'] = "India"; - $country[76]['label'] = "Indonesia"; - $country[77]['label'] = "Iran"; - $country[78]['label'] = "Iraq"; - $country[79]['label'] = "Ireland"; - $country[80]['label'] = "Israel"; - $country[81]['label'] = "Italy"; - $country[82]['label'] = "Jamaica"; - $country[83]['label'] = "Japan"; - $country[84]['label'] = "Jordan"; - $country[85]['label'] = "Kazakhstan"; - $country[86]['label'] = "Kenya"; - $country[87]['label'] = "Kiribati"; - $country[88]['label'] = "North Korea"; - $country[89]['label'] = "South Korea"; - $country[90]['label'] = "Kuwait"; - $country[91]['label'] = "Kyrgyzstan"; - $country[92]['label'] = "Laos"; - $country[93]['label'] = "Latvia"; - $country[94]['label'] = "Lebanon"; - $country[95]['label'] = "Lesotho"; - $country[96]['label'] = "Liberia"; - $country[97]['label'] = "Libya"; - $country[98]['label'] = "Liechtenstein"; - $country[99]['label'] = "Lithuania"; - $country[100]['label'] = "Luxembourg"; - $country[101]['label'] = "Macedonia"; - $country[102]['label'] = "Madagascar"; - $country[103]['label'] = "Malawi"; - $country[104]['label'] = "Malaysia"; - $country[105]['label'] = "Maldives"; - $country[106]['label'] = "Mali"; - $country[107]['label'] = "Malta"; - $country[108]['label'] = "Marshall Islands"; - $country[109]['label'] = "Mauritania"; - $country[110]['label'] = "Mauritius"; - $country[111]['label'] = "Mexico"; - $country[112]['label'] = "Micronesia"; - $country[113]['label'] = "Moldova"; - $country[114]['label'] = "Monaco"; - $country[115]['label'] = "Mongolia"; - $country[116]['label'] = "Montenegro"; - $country[117]['label'] = "Morocco"; - $country[118]['label'] = "Mozambique"; - $country[119]['label'] = "Myanmar"; - $country[120]['label'] = "Namibia"; - $country[121]['label'] = "Nauru"; - $country[122]['label'] = "Nepal"; - $country[123]['label'] = "Netherlands"; - $country[124]['label'] = "New Zealand"; - $country[125]['label'] = "Nicaragua"; - $country[126]['label'] = "Niger"; - $country[127]['label'] = "Nigeria"; - $country[128]['label'] = "Norway"; - $country[129]['label'] = "Oman"; - $country[130]['label'] = "Pakistan"; - $country[131]['label'] = "Palau"; - $country[132]['label'] = "Panama"; - $country[133]['label'] = "Papua New Guinea"; - $country[134]['label'] = "Paraguay"; - $country[135]['label'] = "Peru"; - $country[136]['label'] = "Philippines"; - $country[137]['label'] = "Poland"; - $country[138]['label'] = "Portugal"; - $country[139]['label'] = "Puerto Rico"; - $country[140]['label'] = "Qatar"; - $country[141]['label'] = "Romania"; - $country[142]['label'] = "Russia"; - $country[143]['label'] = "Rwanda"; - $country[144]['label'] = "Saint Kitts and Nevis"; - $country[145]['label'] = "Saint Lucia"; - $country[146]['label'] = "Saint Vincent and the Grenadines"; - $country[147]['label'] = "Samoa"; - $country[148]['label'] = "San Marino"; - $country[149]['label'] = "Sao Tome and Principe"; - $country[150]['label'] = "Saudi Arabia"; - $country[151]['label'] = "Senegal"; - $country[152]['label'] = "Serbia and Montenegro"; - $country[153]['label'] = "Seychelles"; - $country[154]['label'] = "Sierra Leone"; - $country[155]['label'] = "Singapore"; - $country[156]['label'] = "Slovakia"; - $country[157]['label'] = "Slovenia"; - $country[158]['label'] = "Solomon Islands"; - $country[159]['label'] = "Somalia"; - $country[160]['label'] = "South Africa"; - $country[161]['label'] = "Spain"; - $country[162]['label'] = "Sri Lanka"; - $country[163]['label'] = "Sudan"; - $country[164]['label'] = "Suriname"; - $country[165]['label'] = "Swaziland"; - $country[166]['label'] = "Sweden"; - $country[167]['label'] = "Switzerland"; - $country[168]['label'] = "Syria"; - $country[169]['label'] = "Taiwan"; - $country[170]['label'] = "Tajikistan"; - $country[171]['label'] = "Tanzania"; - $country[172]['label'] = "Thailand"; - $country[173]['label'] = "Togo"; - $country[174]['label'] = "Tonga"; - $country[175]['label'] = "Trinidad and Tobago"; - $country[176]['label'] = "Tunisia"; - $country[177]['label'] = "Turkey"; - $country[178]['label'] = "Turkmenistan"; - $country[179]['label'] = "Tuvalu"; - $country[180]['label'] = "Uganda"; - $country[181]['label'] = "Ukraine"; - $country[182]['label'] = "United Arab Emirates"; - $country[183]['label'] = "United Kingdom"; - $country[184]['label'] = "United States"; - $country[185]['label'] = "Uruguay"; - $country[186]['label'] = "Uzbekistan"; - $country[187]['label'] = "Vanuatu"; - $country[188]['label'] = "Vatican City"; - $country[189]['label'] = "Venezuela"; - $country[190]['label'] = "Vietnam"; - $country[191]['label'] = "Yemen"; - $country[192]['label'] = "Zambia"; - $country[193]['label'] = "Zimbabwe"; - - - $country[0]['value'] = "Afghanistan"; - $country[1]['value'] = "Albania"; - $country[2]['value'] = "Algeria"; - $country[3]['value'] = "Andorra"; - $country[4]['value'] = "Antigua and Barbuda"; - $country[5]['value'] = "Argentina"; - $country[6]['value'] = "Armenia"; - $country[7]['value'] = "Australia"; - $country[8]['value'] = "Austria"; - $country[9]['value'] = "Azerbaijan"; - $country[10]['value'] = "Bahamas"; - $country[11]['value'] = "Bahrain"; - $country[12]['value'] = "Bangladesh"; - $country[13]['value'] = "Barbados"; - $country[14]['value'] = "Belarus"; - $country[15]['value'] = "Belgium"; - $country[16]['value'] = "Belize"; - $country[17]['value'] = "Benin"; - $country[18]['value'] = "Bhutan"; - $country[19]['value'] = "Bolivia"; - $country[20]['value'] = "Bosnia and Herzegovina"; - $country[21]['value'] = "Botswana"; - $country[22]['value'] = "Brazil"; - $country[23]['value'] = "Brunei"; - $country[24]['value'] = "Bulgaria"; - $country[25]['value'] = "Burkina Faso"; - $country[26]['value'] = "Burundi"; - $country[27]['value'] = "Cambodia"; - $country[28]['value'] = "Cameroon"; - $country[29]['value'] = "Canada"; - $country[30]['value'] = "Cape Verde"; - $country[31]['value'] = "Central African Republic"; - $country[32]['value'] = "Chad"; - $country[33]['value'] = "Chile"; - $country[34]['value'] = "China"; - $country[35]['value'] = "Colombia"; - $country[36]['value'] = "Comoros"; - $country[37]['value'] = "Congo"; - $country[38]['value'] = "Costa Rica"; - $country[39]['value'] = "Côte d'Ivoire"; - $country[40]['value'] = "Croatia"; - $country[41]['value'] = "Cuba"; - $country[42]['value'] = "Cyprus"; - $country[43]['value'] = "Czech Republic"; - $country[44]['value'] = "Denmark"; - $country[45]['value'] = "Djibouti"; - $country[46]['value'] = "Dominica"; - $country[47]['value'] = "Dominican Republic"; - $country[48]['value'] = "East Timor"; - $country[49]['value'] = "Ecuador"; - $country[50]['value'] = "Egypt"; - $country[51]['value'] = "El Salvador"; - $country[52]['value'] = "Equatorial Guinea"; - $country[53]['value'] = "Eritrea"; - $country[54]['value'] = "Estonia"; - $country[55]['value'] = "Ethiopia"; - $country[56]['value'] = "Fiji"; - $country[57]['value'] = "Finland"; - $country[58]['value'] = "France"; - $country[59]['value'] = "Gabon"; - $country[60]['value'] = "Gambia"; - $country[61]['value'] = "Georgia"; - $country[62]['value'] = "Germany"; - $country[63]['value'] = "Ghana"; - $country[64]['value'] = "Greece"; - $country[65]['value'] = "Grenada"; - $country[66]['value'] = "Guatemala"; - $country[67]['value'] = "Guinea"; - $country[68]['value'] = "Guinea-Bissau"; - $country[69]['value'] = "Guyana"; - $country[70]['value'] = "Haiti"; - $country[71]['value'] = "Honduras"; - $country[72]['value'] = "Hong Kong"; - $country[73]['value'] = "Hungary"; - $country[74]['value'] = "Iceland"; - $country[75]['value'] = "India"; - $country[76]['value'] = "Indonesia"; - $country[77]['value'] = "Iran"; - $country[78]['value'] = "Iraq"; - $country[79]['value'] = "Ireland"; - $country[80]['value'] = "Israel"; - $country[81]['value'] = "Italy"; - $country[82]['value'] = "Jamaica"; - $country[83]['value'] = "Japan"; - $country[84]['value'] = "Jordan"; - $country[85]['value'] = "Kazakhstan"; - $country[86]['value'] = "Kenya"; - $country[87]['value'] = "Kiribati"; - $country[88]['value'] = "North Korea"; - $country[89]['value'] = "South Korea"; - $country[90]['value'] = "Kuwait"; - $country[91]['value'] = "Kyrgyzstan"; - $country[92]['value'] = "Laos"; - $country[93]['value'] = "Latvia"; - $country[94]['value'] = "Lebanon"; - $country[95]['value'] = "Lesotho"; - $country[96]['value'] = "Liberia"; - $country[97]['value'] = "Libya"; - $country[98]['value'] = "Liechtenstein"; - $country[99]['value'] = "Lithuania"; - $country[100]['value'] = "Luxembourg"; - $country[101]['value'] = "Macedonia"; - $country[102]['value'] = "Madagascar"; - $country[103]['value'] = "Malawi"; - $country[104]['value'] = "Malaysia"; - $country[105]['value'] = "Maldives"; - $country[106]['value'] = "Mali"; - $country[107]['value'] = "Malta"; - $country[108]['value'] = "Marshall Islands"; - $country[109]['value'] = "Mauritania"; - $country[110]['value'] = "Mauritius"; - $country[111]['value'] = "Mexico"; - $country[112]['value'] = "Micronesia"; - $country[113]['value'] = "Moldova"; - $country[114]['value'] = "Monaco"; - $country[115]['value'] = "Mongolia"; - $country[116]['value'] = "Montenegro"; - $country[117]['value'] = "Morocco"; - $country[118]['value'] = "Mozambique"; - $country[119]['value'] = "Myanmar"; - $country[120]['value'] = "Namibia"; - $country[121]['value'] = "Nauru"; - $country[122]['value'] = "Nepal"; - $country[123]['value'] = "Netherlands"; - $country[124]['value'] = "New Zealand"; - $country[125]['value'] = "Nicaragua"; - $country[126]['value'] = "Niger"; - $country[127]['value'] = "Nigeria"; - $country[128]['value'] = "Norway"; - $country[129]['value'] = "Oman"; - $country[130]['value'] = "Pakistan"; - $country[131]['value'] = "Palau"; - $country[132]['value'] = "Panama"; - $country[133]['value'] = "Papua New Guinea"; - $country[134]['value'] = "Paraguay"; - $country[135]['value'] = "Peru"; - $country[136]['value'] = "Philippines"; - $country[137]['value'] = "Poland"; - $country[138]['value'] = "Portugal"; - $country[139]['value'] = "Puerto Rico"; - $country[140]['value'] = "Qatar"; - $country[141]['value'] = "Romania"; - $country[142]['value'] = "Russia"; - $country[143]['value'] = "Rwanda"; - $country[144]['value'] = "Saint Kitts and Nevis"; - $country[145]['value'] = "Saint Lucia"; - $country[146]['value'] = "Saint Vincent and the Grenadines"; - $country[147]['value'] = "Samoa"; - $country[148]['value'] = "San Marino"; - $country[149]['value'] = "Sao Tome and Principe"; - $country[150]['value'] = "Saudi Arabia"; - $country[151]['value'] = "Senegal"; - $country[152]['value'] = "Serbia and Montenegro"; - $country[153]['value'] = "Seychelles"; - $country[154]['value'] = "Sierra Leone"; - $country[155]['value'] = "Singapore"; - $country[156]['value'] = "Slovakia"; - $country[157]['value'] = "Slovenia"; - $country[158]['value'] = "Solomon Islands"; - $country[159]['value'] = "Somalia"; - $country[160]['value'] = "South Africa"; - $country[161]['value'] = "Spain"; - $country[162]['value'] = "Sri Lanka"; - $country[163]['value'] = "Sudan"; - $country[164]['value'] = "Suriname"; - $country[165]['value'] = "Swaziland"; - $country[166]['value'] = "Sweden"; - $country[167]['value'] = "Switzerland"; - $country[168]['value'] = "Syria"; - $country[169]['value'] = "Taiwan"; - $country[170]['value'] = "Tajikistan"; - $country[171]['value'] = "Tanzania"; - $country[172]['value'] = "Thailand"; - $country[173]['value'] = "Togo"; - $country[174]['value'] = "Tonga"; - $country[175]['value'] = "Trinidad and Tobago"; - $country[176]['value'] = "Tunisia"; - $country[177]['value'] = "Turkey"; - $country[178]['value'] = "Turkmenistan"; - $country[179]['value'] = "Tuvalu"; - $country[180]['value'] = "Uganda"; - $country[181]['value'] = "Ukraine"; - $country[182]['value'] = "United Arab Emirates"; - $country[183]['value'] = "United Kingdom"; - $country[184]['value'] = "United States"; - $country[185]['value'] = "Uruguay"; - $country[186]['value'] = "Uzbekistan"; - $country[187]['value'] = "Vanuatu"; - $country[188]['value'] = "Vatican City"; - $country[189]['value'] = "Venezuela"; - $country[190]['value'] = "Vietnam"; - $country[191]['value'] = "Yemen"; - $country[192]['value'] = "Zambia"; - $country[193]['value'] = "Zimbabwe"; - - //check for error - $error_class = ''; - $error_message = ''; - $span_required = ''; - $guidelines = ''; - global $lang; - - if(!empty($element->is_error)){ - $error_class = 'class="error"'; - $error_message = "

    {$element->error_message}

    "; - } - - //check for required - if($element->is_required){ - $span_required = "id}\" class=\"required\">*"; - } - - //check for guidelines - if(!empty($element->guidelines)){ - $guidelines = "

    id}\">{$element->guidelines}

    "; - } - - - //create country markup, if no default value, provide a blank option - if(empty($element->default_value)){ - $country_markup = ''."\n"; - }else{ - $country_markup = ''; - } - - foreach ($country as $data){ - if($data['value'] == $element->default_value){ - $selected = 'selected="selected"'; - }else{ - $selected = ''; - } - - //check for populated value, use it instead of default value - if(!empty($element->populated_value['element_'.$element->id.'_6']['default_value'])){ - $selected = ''; - if($element->populated_value['element_'.$element->id.'_6']['default_value'] == $data['value']){ - $selected = 'selected="selected"'; - } - } - - $country_markup .= "\n"; - } - -$element_markup = << - - -
    - - -
    - -
    - - -
    - -
    - - -
    - -
    - - -
    - -
    - - -
    - -
    - - -
     {$guidelines} {$error_message} - -EOT; - - - return $element_markup; - } - - - //Captcha - function display_captcha($element){ - - if(!empty($element->error_message)){ - $error_code = $element->error_message; - }else{ - $error_code = ''; - } - - //check for error - $error_class = ''; - $error_message = ''; - $span_required = ''; - $guidelines = ''; - global $lang; - - if(!empty($element->is_error)){ - - if($element->error_message == 'el-required'){ - $element->error_message = $lang['captcha_required']; - $error_code = ''; - }elseif ($element->error_message == 'incorrect-captcha-sol'){ - $element->error_message = $lang['captcha_mismatch']; - }else{ - $element->error_message = "{$lang['captcha_error']} ({$element->error_message})"; - } - - $error_class = 'class="error"'; - $error_message = "

    {$element->error_message}

    "; - } - - if(!empty($_SERVER['HTTPS'])){ - $use_ssl = true; - }else{ - $use_ssl = false; - } - - - if(USE_INTERNAL_CAPTCHA === true){ //use the internal captcha if enabled - - $machform_path = ''; - if(!empty($element->machform_path)){ - $machform_path = $element->machform_path; - } - - $timestamp = time(); //use this as paramater for captcha.php, to prevent caching - - $element->title = $lang['captcha_title']; -$captcha_html = <<
    -
    -EOT; - - }else{ //otherwise use the reCAPTCHA - $captcha_html = recaptcha_get_html(RECAPTCHA_PUBLIC_KEY, $error_code,$use_ssl); - - if($captcha_html === false){ - $domain = str_replace('www.','',$_SERVER['SERVER_NAME']); - $captcha_html = "Error! You have enabled CAPTCHA but no API key available.

    To use CAPTCHA you must get an API key from http://recaptcha.net/api/getkey

    After getting the API key, save them into your config.php file."; - $error_class = 'class="error"'; - } - } - - - if(function_exists("form{$element->form_id}_hook_pre_captcha")){ - $custom_precaptcha = call_user_func("form{$element->form_id}_hook_pre_captcha"); - } - -$element_markup = << {$custom_precaptcha} - -
    - {$captcha_html} -
    - {$guidelines} {$error_message} - -EOT; - - return $element_markup; - } - - - //Main function to display a form - //There are few mode when displaying a form - //1. New blank form (form populated with default values) - //2. New form with error (displayed when 1 submitted and having error, form populated with user inputs) - //3. Edit form (form populated with data from db) - //4. Edit form with error (displayed when 3 submiteed and having error) - function display_form($form_id,$populated_values=array(),$error_elements=array(),$custom_error='',$edit_id=0,$embed=false){ - - global $lang; - - $agent_info = new uagent_info(); - - //if there is custom error, don't show other errors - if(!empty($custom_error)){ - $error_elements = array(); - } - - //get form properties data - $query = "select - form_name, - form_description, - form_redirect, - form_success_message, - form_password, - form_unique_ip, - form_frame_height, - form_has_css, - form_active, - form_captcha, - form_review - from - ap_forms - where - form_id='$form_id'"; - $result = do_query($query); - $row = do_fetch_result($result); - - $form = new stdClass(); - - $form->id = $form_id; - $form->name = $row['form_name']; - $form->description = $row['form_description']; - $form->redirect = $row['form_redirect']; - $form->success_message = $row['form_success_message']; - $form->password = $row['form_password']; - $form->frame_height = $row['form_frame_height']; - $form->unique_ip = $row['form_unique_ip']; - $form->has_css = $row['form_has_css']; - $form->active = $row['form_active']; - $form->captcha = $row['form_captcha']; - $form->review = $row['form_review']; - - if(empty($error_elements)){ - $form->is_error = 0; - }else{ - $form->is_error = 1; - } - - //if this form has review enabled and user are having $_SESSION['review_id'], then populate the form with that values - if(!empty($form->review) && !empty($_SESSION['review_id']) && empty($populated_values)){ - $populated_values = get_entry_values($form_id,$_SESSION['review_id'],true); - } - - //get elements data - //get element options first and store it into array - $query = "select - element_id, - option_id, - `position`, - `option`, - option_is_default - from - ap_element_options - where - form_id='$form_id' and live=1 - order by - element_id asc,`position` asc"; - $result = do_query($query); - while($row = do_fetch_result($result)){ - $element_id = $row['element_id']; - $option_id = $row['option_id']; - $options_lookup[$element_id][$option_id]['position'] = $row['position']; - $options_lookup[$element_id][$option_id]['option'] = $row['option']; - $options_lookup[$element_id][$option_id]['option_is_default'] = $row['option_is_default']; - } - - - //get elements data - $element = array(); - $query = "select - element_id, - element_title, - element_guidelines, - element_size, - element_is_required, - element_is_unique, - element_is_private, - element_type, - element_position, - element_default_value, - element_constraint - from - ap_form_elements - where - form_id='$form_id' - order by - element_position asc"; - $result = do_query($query); - - $j=0; - $has_calendar = false; //assume the form doesn't have calendar, so it won't load calendar.js - while($row = do_fetch_result($result)){ - $element_id = $row['element_id']; - - //lookup element options first - if(!empty($options_lookup[$element_id])){ - $element_options = array(); - $i=0; - foreach ($options_lookup[$element_id] as $option_id=>$data){ - $element_options[$i] = new stdClass(); - $element_options[$i]->id = $option_id; - $element_options[$i]->option = $data['option']; - $element_options[$i]->is_default = $data['option_is_default']; - $element_options[$i]->is_db_live = 1; - $i++; - } - } - - - //populate elements - $element[$j] = new stdClass(); - $element[$j]->title = nl2br($row['element_title']); - $element[$j]->guidelines = $row['element_guidelines']; - $element[$j]->size = $row['element_size']; - $element[$j]->is_required = $row['element_is_required']; - $element[$j]->is_unique = $row['element_is_unique']; - $element[$j]->is_private = $row['element_is_private']; - $element[$j]->type = $row['element_type']; - $element[$j]->position = $row['element_position']; - $element[$j]->id = $row['element_id']; - $element[$j]->is_db_live = 1; - - //this data came from db or form submit - //being used to display edit form or redisplay form with errors and previous inputs - //this should be optimized in the future, only pass necessary data, not the whole array - $element[$j]->populated_value = $populated_values; - - //if there is file upload type, set form enctype to multipart - if($row['element_type'] == 'file'){ - $form_enc_type = 'enctype="multipart/form-data"'; - } - - if(!empty($error_elements[$element[$j]->id])){ - $element[$j]->is_error = 1; - $element[$j]->error_message = $error_elements[$element[$j]->id]; - } - - - $element[$j]->default_value = htmlspecialchars($row['element_default_value']); - - - $element[$j]->constraint = $row['element_constraint']; - if(!empty($element_options)){ - $element[$j]->options = $element_options; - }else{ - $element[$j]->options = ''; - } - - - //check for calendar type - if($row['element_type'] == 'date' || $row['element_type'] == 'europe_date'){ - $has_calendar = true; - } - - $j++; - } - - - //add captcha if enable - if(!empty($form->captcha) && (empty($edit_id))){ - $element[$j] = new stdClass(); - $element[$j]->type = 'captcha'; - $element[$j]->form_id = $form_id; - $element[$j]->is_private = 0; - - if(!empty($error_elements['element_captcha'])){ - $element[$j]->is_error = 1; - $element[$j]->error_message = $error_elements['element_captcha']; - } - } - - //generate html markup for each element - $all_element_markup = ''; - foreach ($element as $element_data){ - if($element_data->is_private && empty($_SESSION['logged_in'])){ //don't show private element - continue; - } - $all_element_markup .= call_user_func('display_'.$element_data->type,$element_data); - } - - if(!empty($custom_error)){ - $form->error_message =<< -

    {$custom_error}

    - -EOT; - }elseif(!empty($error_elements)){ - $form->error_message =<< -

    {$lang['error_title']}

    -

    {$lang['error_desc']}

    - -EOT; - } - - - //display edit_id if there is any - if(!empty($edit_id)){ - $edit_markup = "\n"; - }else{ - $edit_markup = ''; - } - - if(empty($form->review)){ - $button_text = $lang['submit_button']; - }else{ - $button_text = $lang['continue_button']; - } - - //markup for submit button - $button_markup =<< - - {$edit_markup} - - - -EOT; - - //check for specific form css, if any, use it instead - if($form->has_css){ - $css_dir = DATA_DIR."/form_{$form_id}/css/"; - } - - if(!empty($form->password) && empty($_SESSION['user_authenticated'])){ //if form require password and password hasn't set yet - $show_password_form = true; - - }elseif (!empty($form->password) && !empty($_SESSION['user_authenticated']) && $_SESSION['user_authenticated'] != $form_id){ //if user authenticated but not for this form - $show_password_form = true; - - }else{ //user authenticated for this form, or no password required - $show_password_form = false; - } - - - if(empty($form->active)){ //if form is not active, don't show the fields - $form_desc_div =''; - $all_element_markup = ''; - $button_markup = ''; - $ul_class = 'class="password"'; - $custom_element =<< -

    {$lang['form_inactive']}

    - -EOT; - }elseif($show_password_form){ //don't show form description if this page is password protected and user not authenticated - $form_desc_div =''; - $all_element_markup = ''; - $custom_element =<< -

    {$lang['form_pass_title']}

    -
    - - -
    - -EOT; - $ul_class = 'class="password"'; - }else{ - if(!empty($form->name) || !empty($form->description)){ - $form->description = nl2br($form->description); - $form_desc_div =<< -

    {$form->name}

    -

    {$form->description}

    - -EOT; - } - } - - if($embed){ - $embed_class = 'class="embed"'; - } - - if($has_calendar){ - $calendar_js = ''; - }else{ - $calendar_js = ''; - } - - - if ($agent_info->DetectIphoneOrIpod()) { - $soy_un_movil = 'SOY UN MOVIL'; - } - else { - $soy_un_movil = 'NO SOY UN MOVIL'; - } - - //If you would like to remove the "Powered by MachForm" link, please contact us at customer.service@appnitro.com before doing so - $form_markup = << - - - -{$form->name} - - -{$calendar_js} - - - - - - -
    - -

    {$form->name}

    -{$soy_un_movil} -
    - {$form_desc_div} -
      - {$form->error_message} - {$all_element_markup} - {$custom_element} - {$button_markup} -
    -
    - -
    - - - -EOT; - return $form_markup; - - } - - //this function is similar as display_form, but designed to display form without IFRAME - function display_integrated_form($form_id,$populated_values=array(),$error_elements=array(),$custom_error='',$edit_id=0,$machform_path){ - - global $lang; - - //if there is custom error, don't show other errors - if(!empty($custom_error)){ - $error_elements = array(); - } - - //get form properties data - $query = "select - form_name, - form_description, - form_redirect, - form_success_message, - form_password, - form_unique_ip, - form_frame_height, - form_has_css, - form_active, - form_captcha, - form_review - from - ap_forms - where - form_id='$form_id'"; - $result = do_query($query); - $row = do_fetch_result($result); - - $form = new stdClass(); - - $form->id = $form_id; - $form->name = $row['form_name']; - $form->description = $row['form_description']; - $form->redirect = $row['form_redirect']; - $form->success_message = $row['form_success_message']; - $form->password = $row['form_password']; - $form->frame_height = $row['form_frame_height']; - $form->unique_ip = $row['form_unique_ip']; - $form->has_css = $row['form_has_css']; - $form->active = $row['form_active']; - $form->captcha = $row['form_captcha']; - $form->review = $row['form_review']; - - if(empty($error_elements)){ - $form->is_error = 0; - }else{ - $form->is_error = 1; - } - - //if this form has review enabled and user are having $_SESSION['review_id'], then populate the form with that values - if(!empty($form->review) && !empty($_SESSION['review_id']) && empty($populated_values)){ - $param['machform_path'] = $machform_path; - $populated_values = get_entry_values($form_id,$_SESSION['review_id'],true,$param); - } - - //get elements data - //get element options first and store it into array - $query = "select - element_id, - option_id, - `position`, - `option`, - option_is_default - from - ap_element_options - where - form_id='$form_id' and live=1 - order by - element_id asc,`position` asc"; - $result = do_query($query); - while($row = do_fetch_result($result)){ - $element_id = $row['element_id']; - $option_id = $row['option_id']; - $options_lookup[$element_id][$option_id]['position'] = $row['position']; - $options_lookup[$element_id][$option_id]['option'] = $row['option']; - $options_lookup[$element_id][$option_id]['option_is_default'] = $row['option_is_default']; - } - - - //get elements data - $element = array(); - $query = "select - element_id, - element_title, - element_guidelines, - element_size, - element_is_required, - element_is_unique, - element_is_private, - element_type, - element_position, - element_default_value, - element_constraint - from - ap_form_elements - where - form_id='$form_id' - order by - element_position asc"; - $result = do_query($query); - - $j=0; - $has_calendar = false; - while($row = do_fetch_result($result)){ - $element_id = $row['element_id']; - - //lookup element options first - if(!empty($options_lookup[$element_id])){ - $element_options = array(); - $i=0; - foreach ($options_lookup[$element_id] as $option_id=>$data){ - $element_options[$i] = new stdClass(); - $element_options[$i]->id = $option_id; - $element_options[$i]->option = $data['option']; - $element_options[$i]->is_default = $data['option_is_default']; - $element_options[$i]->is_db_live = 1; - $i++; - } - } - - - //populate elements - $element[$j] = new stdClass(); - $element[$j]->title = nl2br($row['element_title']); - - if(empty($edit_id)){ - $element[$j]->guidelines = $row['element_guidelines']; - }else{ - $element[$j]->guidelines = ''; - } - - $element[$j]->size = $row['element_size']; - $element[$j]->is_required = $row['element_is_required']; - $element[$j]->is_unique = $row['element_is_unique']; - $element[$j]->is_private = $row['element_is_private']; - $element[$j]->type = $row['element_type']; - $element[$j]->position = $row['element_position']; - $element[$j]->id = $row['element_id']; - $element[$j]->is_db_live = 1; - $element[$j]->machform_path = $machform_path; - - //this data came from db or form submit - //being used to display edit form or redisplay form with errors and previous inputs - //this should be optimized in the future, only pass necessary data, not the whole array - $element[$j]->populated_value = $populated_values; - - //if there is file upload type, set form enctype to multipart - if($row['element_type'] == 'file'){ - $form_enc_type = 'enctype="multipart/form-data"'; - } - - if(!empty($error_elements[$element[$j]->id])){ - $element[$j]->is_error = 1; - $element[$j]->error_message = $error_elements[$element[$j]->id]; - } - - - $element[$j]->default_value = htmlspecialchars($row['element_default_value']); - - - $element[$j]->constraint = $row['element_constraint']; - if(!empty($element_options)){ - $element[$j]->options = $element_options; - }else{ - $element[$j]->options = ''; - } - - //check for calendar type - if($row['element_type'] == 'date' || $row['element_type'] == 'europe_date'){ - $has_calendar = true; - } - - $j++; - } - - - //add captcha if enable - if(!empty($form->captcha) && (empty($edit_id))){ - $element[$j] = new stdClass(); - $element[$j]->type = 'captcha'; - $element[$j]->form_id = $form_id; - $element[$j]->machform_path = $machform_path; - - if(!empty($error_elements['element_captcha'])){ - $element[$j]->is_error = 1; - $element[$j]->error_message = $error_elements['element_captcha']; - } - } - - //generate html markup for each element - $all_element_markup = ''; - foreach ($element as $element_data){ - if($element_data->is_private && empty($_SESSION['logged_in'])){ //don't show private element - continue; - } - $all_element_markup .= call_user_func('display_'.$element_data->type,$element_data); - } - - if(!empty($custom_error)){ - $form->error_message =<< -

    {$custom_error}

    - -EOT; - }elseif(!empty($error_elements)){ - $form->error_message =<< -

    {$lang['error_title']}

    -

    {$lang['error_desc']}

    - -EOT; - } - - if(!empty($form->password) && empty($_SESSION['user_authenticated'])){ //if form require password and password hasn't set yet - $show_password_form = true; - - }elseif (!empty($form->password) && !empty($_SESSION['user_authenticated']) && $_SESSION['user_authenticated'] != $form_id){ //if user authenticated but not for this form - $show_password_form = true; - - }else{ //user authenticated for this form, or no password required - $show_password_form = false; - } - - //display edit_id if there is any - if(!empty($edit_id)){ - $edit_markup = "\n"; - $submit_button = ''; - }else{ - $edit_markup = ''; - - if(!empty($form->review) && !$show_password_form){ - $submit_button = ''."\n".''; - }else{ - $submit_button = ''."\n".''; - } - } - - - //markup for submit button - $button_markup =<< - - {$edit_markup} - {$submit_button} - -EOT; - - //check for specific form css, if any, use it instead - if($form->has_css){ - $css_dir = DATA_DIR."/form_{$form_id}/css/"; - } - - - if(empty($form->active)){ //if form is not active, don't show the fields - $form_desc_div =''; - $all_element_markup = ''; - $button_markup = ''; - $ul_class = 'class="password"'; - $custom_element =<< -

    {$lang['form_inactive']}

    - -EOT; - }elseif($show_password_form){ //don't show form description if this page is password protected and user not authenticated - $form_desc_div =''; - $all_element_markup = ''; - $custom_element =<< -

    {$lang['form_pass_title']}

    -
    - - -
    - -EOT; - $ul_class = 'class="password"'; - }else{ - if(!empty($form->name) || !empty($form->description)){ - $form->description = nl2br($form->description); - $form_desc_div =<< -

    {$form->name}

    -

    {$form->description}

    - -EOT; - } - } - - - $embed_class = 'class="integrated"'; - - if(empty($edit_id)){ - $css_markup = ""; - }else{ - $css_markup = ""; - } - - if($has_calendar){ - $calendar_js = ""; - }else{ - $calendar_js = ''; - } - - - //If you would like to remove the "Powered by MachForm" link, please contact us at customer.service@appnitro.com before doing so - $form_markup =<< -{$calendar_js} - -
    - -
    - -

    {$form->name}

    -
    - {$form_desc_div} -
      - {$form->error_message} - {$all_element_markup} - {$custom_element} - {$button_markup} -
    -
    - -
    -
    -EOT; - return $form_markup; - - } - - function display_success($form_id,$embed=false){ - //get form properties data - $query = "select - form_success_message, - form_has_css, - form_name - from - ap_forms - where - form_id='$form_id'"; - - $result = do_query($query); - $row = do_fetch_result($result); - - $form = new stdClass(); - - $form->id = $form_id; - $form->success_message = nl2br($row['form_success_message']); - $form->has_css = $row['form_has_css']; - $form->name = $row['form_name']; - - - //check for specific form css, if any, use it instead - if($form->has_css){ - $css_dir = DATA_DIR."/form_{$form_id}/css/"; - } - - if($embed){ - $embed_class = 'class="embed"'; - } - - $form_markup = << - - - -{$form->name} - - - - - -
    - -

    Appnitro MachForm

    - -
    -

    {$form->success_message}

    -
    - -
    - - - -EOT; - return $form_markup; - } - - //this function is similar as display_success, but designed to display success page without IFRAME - function display_integrated_success($form_id,$machform_path){ - //get form properties data - $query = "select - form_success_message, - form_has_css - from - ap_forms - where - form_id='$form_id'"; - - $result = do_query($query); - $row = do_fetch_result($result); - - $form = new stdClass(); - - $form->id = $form_id; - $form->success_message = nl2br($row['form_success_message']); - $form->has_css = $row['form_has_css']; - - - //check for specific form css, if any, use it instead - if($form->has_css){ - $css_dir = DATA_DIR."/form_{$form_id}/css/"; - } - - - $form_markup = << -
    -
    -

    Appnitro MachForm

    - -
    -

    {$form->success_message}

    -
    - -
    -
    -EOT; - return $form_markup; - } - - //display form confirmation page - function display_form_review($form_id,$record_id,$embed=false){ - global $lang; - - //get form properties data - $query = "select - form_has_css, - form_redirect - from - ap_forms - where - form_id='$form_id'"; - - $result = do_query($query); - $row = do_fetch_result($result); - - - $form_has_css = $row['form_has_css']; - $form_redirect = $row['form_redirect']; - - //prepare entry data for previewing - $param['strip_download_link'] = true; - $param['review_mode'] = true; - $param['show_attach_image'] = true; - $entry_details = get_entry_details($form_id,$record_id,$param); - - $entry_data = ''."\n"; - - $toggle = false; - foreach ($entry_details as $data){ - if($toggle){ - $toggle = false; - $row_style = 'class="alt"'; - }else{ - $toggle = true; - $row_style = ''; - } - - $entry_data .= "\n"; - $entry_data .= "\n"; - $entry_data .= "\n"; - $entry_data .= "\n"; - } - - $entry_data .= '
    {$data['label']}".nl2br($data['value'])."
    '; - - //check for specific form css, if any, use it instead - if($form_has_css){ - $css_dir = DATA_DIR."/form_{$form_id}/css/"; - } - - if($embed){ - $embed_class = 'class="embed"'; - } - - $form_markup = << - - - -{$form_name} - - - - - - - - -
    - -

    Appnitro MachForm

    -
    -
    -

    {$lang['review_title']}

    -

    {$lang['review_message']}

    -
    - {$entry_data} -
      -
    • - - - -
    • -
    -
    - -
    - - - -EOT; - return $form_markup; - } - - //display form confirmation page for integrated embed code - function display_integrated_form_review($form_id,$record_id,$machform_path){ - global $lang; - - //get form properties data - $query = "select - form_has_css, - form_redirect - from - ap_forms - where - form_id='$form_id'"; - - $result = do_query($query); - $row = do_fetch_result($result); - - - $form_has_css = $row['form_has_css']; - $form_redirect = $row['form_redirect']; - - //prepare entry data for previewing - $param['strip_download_link'] = true; - $param['review_mode'] = true; - $param['show_attach_image'] = true; - $param['machform_path'] = $machform_path; - $entry_details = get_entry_details($form_id,$record_id,$param); - - $entry_data = ''."\n"; - - $toggle = false; - foreach ($entry_details as $data){ - if($toggle){ - $toggle = false; - $row_style = 'class="alt"'; - }else{ - $toggle = true; - $row_style = ''; - } - - $entry_data .= "\n"; - $entry_data .= "\n"; - $entry_data .= "\n"; - $entry_data .= "\n"; - } - - $entry_data .= '
    {$data['label']}".nl2br($data['value'])."
    '; - - //check for specific form css, if any, use it instead - if($form_has_css){ - $css_dir = DATA_DIR."/form_{$form_id}/css/"; - } - - if($embed){ - $embed_class = 'class="embed"'; - } - - $form_action = str_replace(array("&show_review=1","?show_review=1"),"",$_SERVER['REQUEST_URI']); - - $form_markup = << - - - - -
    -
    -

    Appnitro MachForm

    -
    -
    -

    {$lang['review_title']}

    -

    {$lang['review_message']}

    -
    - {$entry_data} -
      -
    • - - - -
    • -
    -
    - -
    -
    -EOT; - return $form_markup; - } +DetectIphoneOrIpod()) { + return \mobile_view_funcions\display_form($form_id, $populated_values, $error_elements, $custom_error, $edit_id, $embed); + } + else { + return \standard_view_funcions\display_form($form_id, $populated_values, $error_elements, $custom_error, $edit_id, $embed); + } + } + + //this function is similar as display_form, but designed to display form without IFRAME + function display_integrated_form($form_id,$populated_values=array(),$error_elements=array(),$custom_error='',$edit_id=0,$machform_path){ + + $agent_info = new uagent_info(); + + if ($agent_info->DetectIphoneOrIpod()) { + return \mobile_view_funcions\display_integrated_form($form_id, $populated_values, $error_elements, $custom_error, $edit_id, $machform_path); + } + else { + return \standard_view_funcions\display_integrated_form($form_id, $populated_values, $error_elements, $custom_error, $edit_id, $machform_path); + } + } + + function display_success($form_id,$embed=false){ + + $agent_info = new uagent_info(); + + if ($agent_info->DetectIphoneOrIpod()) { + return \mobile_view_funcions\display_success($form_id, $embed); + } + else { + return \standard_view_funcions\display_success($form_id, $embed); + } + } + + //this function is similar as display_success, but designed to display success page without IFRAME + function display_integrated_success($form_id,$machform_path){ + + $agent_info = new uagent_info(); + + if ($agent_info->DetectIphoneOrIpod()) { + return \mobile_view_funcions\display_integrated_success($form_id, $machform_path); + } + else { + return \standard_view_funcions\display_integrated_success($form_id, $machform_path); + } + } + + //display form confirmation page + function display_form_review($form_id,$record_id,$embed=false){ + + $agent_info = new uagent_info(); + + if ($agent_info->DetectIphoneOrIpod()) { + return \mobile_view_funcions\display_form_review($form_id, $record_id, $embed); + } + else { + return \standard_view_funcions\display_form_review($form_id, $record_id, $embed); + } + } + + //display form confirmation page for integrated embed code + function display_integrated_form_review($form_id,$record_id,$machform_path){ + + $agent_info = new uagent_info(); + + if ($agent_info->DetectIphoneOrIpod()) { + return \mobile_view_funcions\display_integrated_form_review($form_id, $record_id, $machform_path); + } + else { + return \standard_view_funcions\display_integrated_form_review($form_id, $record_id, $machform_path); + } + } ?> \ No newline at end of file diff --git a/mobile/apple/css/developer-style.css b/mobile/apple/css/developer-style.css new file mode 100644 index 0000000..b50c80a --- /dev/null +++ b/mobile/apple/css/developer-style.css @@ -0,0 +1,1138 @@ +/*iWebKit css 5.04 by Christopher Plieger*/ +body { + position: relative; + margin: 0; + -webkit-text-size-adjust: none; + min-height: 416px; + font-family: helvetica,sans-serif; + -webkit-background-size:0.438em 100%; + background: -webkit-gradient(linear,left top,right top,from(#c5ccd4), color-stop(71%, #c5ccd4), color-stop(72%, #cbd2d8), to(#cbd2d8)); + -webkit-touch-callout: none; +} +.center { + margin: auto; + display: block; + text-align: center!important; +} +img { + border: 0; +} +a:hover .arrow { + background-position: 0 -13px!important; +} +@media screen and (max-width: 320px) +{ +#topbar { + height: 44px; +} +#title { + line-height: 44px; + height: 44px; + font-size: 16pt; +} +#tributton a:first-child, #duobutton a:first-child { + width: 101px; +} +#tributton a:last-child, #duobutton a:last-child { + width: 101px; +} +#tributton a { + width: 106px; +} +#duobutton .links { + width: 195px; +} +#tributton .links { + width: 302px; +} +#doublead { + width: 300px!important; +} +#duoselectionbuttons { + width: 191px; + height: 30px; + top: 7px; +} +#triselectionbuttons { + width: 290px; + height: 30px; + top: 7px; +} +#triselectionbuttons a:first-child, #duoselectionbuttons a:first-child { + width: 99px; + height: 28px; + line-height: 28px; +} +#triselectionbuttons a { + width: 98px; + height: 28px; + line-height: 28px; +} +#triselectionbuttons a:last-child, #duoselectionbuttons a:last-child { + width: 99px; + height: 28px; + line-height: 28px; +} +.searchbox form { + width: 272px; +} +.searchbox input[type="text"] { + width: 275px; +} +.menu .name { + max-width: 77%; +}.checkbox .name { + max-width: 190px; +}.radiobutton .name { + max-width: 190px; +} +#leftnav a, #rightnav a, #leftbutton a, #rightbutton a, #blueleftbutton a, #bluerightbutton a { + line-height: 30px; + height: 30px; +} +#leftnav img, #rightnav img { + margin-top: 4px; +} +#leftnav, #leftbutton, #blueleftbutton { + top: 7px; +} +#rightnav, #rightbutton, #bluerightbutton { + top: 7px; +} +.musiclist .name { + max-width:55% +} +.textbox textarea { + width: 280px; +} +.bigfield input{ + width:295px +} +} +@media screen and (min-width: 321px) +{ +#topbar { + height: 32px; +} +#title { + line-height: 32px; + height: 32px; + font-size: 13pt; +} +.menu .name { + max-width: 85%; +}.checkbox .name { + max-width: 75%; +}.radiobutton .name { + max-width: 75%; +} +#leftnav a, #rightnav a, #leftbutton a, #rightbutton a, #blueleftbutton a, #bluerightbutton a { + line-height: 24px; + height: 24px; +} +#leftnav img, #rightnav img { + margin-top: 4px; + height: 70%; +} +#leftnav, #leftbutton, #blueleftbutton { + top: 4px; +} +#rightnav, #rightbutton, #bluerightbutton { + top: 4px; +} +.musiclist .name { + max-width:70% +} +.textbox textarea { + width: 440px; +} +#tributton a:first-child, #duobutton a:first-child { + width: 152px; +} +#tributton a:last-child, #duobutton a:last-child { + width: 152px; +} +#tributton a { + width: 154px; +} +#tributton .links { + width: 452px; +} +#duobutton .links { + width: 298px; +} +#doublead { + width: 350px!important; +} +#duoselectionbuttons { + width: 293px; + height: 24px; + top: 4px; +} +#triselectionbuttons { + width: 450px; + height: 24px; + top: 4px; +} +#triselectionbuttons a:first-child, #duoselectionbuttons a:first-child { + width: 150px; + height: 22px; + line-height: 22px; +} +#triselectionbuttons a { + width: 156px; + height: 22px; + line-height: 22px; +} +#triselectionbuttons a:last-child, #duoselectionbuttons a:last-child { + width: 150px; + height: 22px; + line-height: 22px; +} +.searchbox form { + width: 432px; +} +.searchbox input[type="text"] { + width: 435px; +} +.bigfield input{ + width:455px +} +} +#topbar.black { + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#858585), color-stop(3%, #636363), color-stop(50%, #202020), color-stop(51%, black), color-stop(97%, black), to(#262626)); +} +#topbar.transparent { + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(133,133,133,0.7)), color-stop(3%, rgba(99,99,99,0.7)), color-stop(50%, rgba(32,32,32,0.7)), color-stop(51%, rgba(0,0,0,0.7)), color-stop(97%, rgba(0,0,0,0.7)), to(rgba(38,38,38,0.7))); +} +#topbar { + position: relative; + left: 0; + top: 0; + width: auto; + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#cdd5df), color-stop(3%, #b0bccd), color-stop(50%, #889bb3), color-stop(51%, #8195af), color-stop(97%, #6d84a2), to(#2d3642)); + margin-bottom: 13px; +} +#title { + position: absolute; + font-weight: bold; + top: 0; + left: 0; + right: 0; + padding: 0 10px; + text-align: center; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + color: #FFF; + text-shadow: rgba(0,0,0,0.6) 0 -1px 0; +} +#content { + width: 100%; + position: relative; + min-height: 250px; + margin-top: 10px; + height: auto; + z-index: 0; + overflow: hidden; +} +#footer { + text-align: center; + position: relative; + margin: 20px 10px 0; + height: auto; + width: auto; + bottom: 10px; +} +.ipodlist #footer, .ipodlist #footer a { + text-shadow: #FFF 0 -1px 0; +} +#footer a, #footer { + text-decoration: none; + font-size: 9pt; + color: #4C4C4C; + text-shadow: #FFF 0 1px 0; +} +.pageitem { + -webkit-border-radius: 8px; + background-color: #fff; + border: #878787 solid 1px; + font-size: 12pt; + overflow: hidden; + padding: 0; + position: relative; + display: block; + height: auto; + width: auto; + margin: 3px 9px 17px; + list-style: none; +} +.textbox { + padding: 5px 9px; + position: relative; + overflow: hidden; + border-top: 1px solid #878787; +} +#tributton, #duobutton { + height: 44px; + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#cdd4d9), color-stop(3%, #c0c9cf), color-stop(97%, #abb7bf),to(#81929f)); + margin: -13px 0 13px 0; + text-align: center; +} +#tributton .links, #duobutton .links { + height: 30px; + -webkit-border-image: url("../images/tributton.png") 0 4 0 4; + border-width: 0 4px 0 4px; + margin: 0 auto 0px auto; + position: relative; + top: 7px; +} +#tributton a:first-child, #duobutton a:first-child { + border-right: 1px solid #6d7e91; + -webkit-border-top-left-radius: 5px; + -webkit-border-bottom-left-radius: 5px; + margin-left: -4px; +} +#tributton a, #duobutton a { + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + height: 27px; + display: inline-block; + line-height: 27px; + margin-top: 1px; + font: bold 13px; + text-decoration: none; + color: #3f5c84; + text-shadow: #FFF 0 1px 0; +} +#duobutton a:last-child { + border: 0; +} +#tributton a:last-child { + border-left: 1px solid #6d7e91; +} +#tributton a:last-child, #duobutton a:last-child { + -webkit-border-top-right-radius: 5px; + -webkit-border-bottom-right-radius: 5px; + margin-right: -4px; +} +#tributton a:hover, #tributton a#pressed, #duobutton a:hover, #duobutton a#pressed { + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#7b8b9f), color-stop(3%, #8c9baf), to(#647792)); + color: white; + text-shadow: black 0 -1px 0; +} +#triselectionbuttons, #duoselectionbuttons { + -webkit-border-image: url('../images/navbutton.png') 0 5 0 5; + border-width: 0 5px 0 5px; + position: relative; + margin: auto; +} +#duoselectionbuttons a:first-child { + border: 0; +} +#triselectionbuttons a:first-child { + border-right: solid 1px #556984; +} +#triselectionbuttons a:first-child, #duoselectionbuttons a:first-child { + margin-left: -4px; + -webkit-border-top-left-radius: 6px; + -webkit-border-bottom-left-radius: 6px; +} +#triselectionbuttons a, #duoselectionbuttons a { + display: inline-block; + text-align: center; + color: white; + text-decoration: none; + margin-top: 1px; + text-shadow: black 0 -1px 0; + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#909baa), color-stop(3%, #a5b4c6), color-stop(50%, #798eaa), color-stop(51%, #6b83a1), color-stop(97%, #6e85a3), to(#526379)); +} +#triselectionbuttons a:last-child, #duoselectionbuttons a:last-child { + border-left: solid 1px #556984; + margin-right: -4px; + -webkit-border-top-right-radius: 6px; + -webkit-border-bottom-right-radius: 6px; +} +#triselectionbuttons a:hover, #triselectionbuttons a#pressed, #duoselectionbuttons a:hover, #duoselectionbuttons a#pressed { + background: none; +} +#doublead { + height: 83px!important; + position: relative; + margin: 0 auto 13px auto; +} +#doublead a:first-child { + left: 0!important; +} +#doublead a:last-child { + right: 0!important; +} +#doublead a { + width: 147px!important; + height: 83px!important; + position: absolute; + -webkit-border-radius: 8px; + display: block; + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#7c7c7c), color-stop(3%, #858585), color-stop(97%, #a4a4a4),to(#c2c2c2)); +} +li#doublead { + margin-top: 25px; + margin-bottom: 10px!important; + background: none; +} +li#doublead:hover { + background: none; +} +.searchbox { + height: 44px; + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f1f3f4), color-stop(3%, #e0e4e7), color-stop(50%, #c7cfd4), color-stop(51%, #bec7cd), color-stop(97%, #b4bec6), to(#8999a5)); + margin: -13px 0 13px 0; + width: 100%; +} +.searchbox form { + height: 24px; + -webkit-border-image: url('../images/searchfield.png') 4 14 1 24; + border-width: 4px 14px 1px 24px; + display: block; + position: relative; + top: 8px; + margin: auto; +} +fieldset { + border: 0; + margin: 0; + padding: 0; +} +.searchbox input[type="text"] { + border: 0; + -webkit-appearance: none; + height: 18px; + float: left; + font-size: 13px; + padding: 0; + position: relative; + top: 2px; + left: 2px; +} +.textbox img { + max-width: 100%; +} +.textbox p { + margin-top: 2px; +} +.textbox p { + margin-top: 2px; + color: #000; + margin-bottom: 2px; + text-align: justify; +} +.textbox img { + max-width: 100%; +} +.textbox ul { + margin: 3px 0 3px 0; + list-style: circle!important; +} +.textbox li { + margin: 0!important; +} +.pageitem li:first-child, .pageitem li.form:first-child { + border-top: 0; +} +.menu, .checkbox, .radiobutton, .select, li.button, li.bigfield, li.smallfield { + position: relative; + list-style-type: none; + display: block; + height: 43px; + overflow: hidden; + border-top: 1px solid #878787; + width: auto; +} +.pageitem li:first-child:hover, .pageitem li:first-child a, .radiobutton:first-child input, .select:first-child select, li.button:first-child input, .bigfield:first-child input { + -webkit-border-top-left-radius: 8px; + -webkit-border-top-right-radius: 8px; +} +.pageitem li:last-child:hover, .pageitem li:last-child a, .radiobutton:last-child input, .select:last-child select, li.button:last-child input, .bigfield:last-child input { + -webkit-border-bottom-left-radius: 8px; + -webkit-border-bottom-right-radius: 8px; +} +.menu:hover, .store:hover, .list #content li a:hover, .list .withimage:hover, .applist li:hover:nth-child(n),.ipodlist li:hover:nth-child(n) { + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#058cf5), to(#015fe6)); +} +.ipodlist li:hover:nth-child(n) .name,.ipodlist li:hover:nth-child(n) .time{border:0} +.menu a:hover .name, .store:hover .starcomment, .store:hover .name, .store:hover .comment, .list .withimage a:hover .comment { + color: #fff; +} +.menu a:hover .comment { + color: #CCF; +} +.menu a { + display: block; + height: 43px; + width: auto; + text-decoration: none; +} +.menu a img { + width: auto; + height: 32px; + margin: 5px 0 0 5px; + float: left; +} +.menu .name, .checkbox .name, .radiobutton .name { + margin: 11px 0 0 7px; + width: auto; + color: #000; + font-weight: bold; + font-size: 17px; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + float: left; +} +.menu .comment { + margin: 11px 30px 0 0; + width: auto; + font-size: 17px; + text-overflow: ellipsis; + overflow: hidden; + max-width: 75%; + white-space: nowrap; + float: right; + color: #324f85; +} +.menu .arrow, .store .arrow, .musiclist .arrow, .list .arrow { + position: absolute; + width: 8px!important; + height: 13px!important; + right: 10px; + top: 15px; + margin: 0!important; + background: url("../images/arrow.png") 0 0 no-repeat; +} +.applist .arrow { + position: absolute; + width: 8px!important; + height: 13px!important; + right: 10px; + top: 29px; + margin: 0!important; + background: url("../images/arrow.png") 0 0 no-repeat; +} +.store { + height: 90px; + border-top: #878787 solid 1px; + overflow: hidden; + position: relative; +} +.store a { + width: 100%; + height: 90px; + display: block; + text-decoration: none; + position: absolute; +} +.store .image { + position: absolute; + left: 0; + top: 0; + height: 90px; + width: 90px; + display: block; + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#eff1f5), to(#d6dce6)); + -webkit-background-size: 90px; +} +.applist .image { + width: 57px; + height: 57px; + display: block; + position: absolute; + top: 7px; + left: 11px; + -webkit-border-radius: 8px; + -webkit-box-shadow: 0 2px 3px rgb(0,0,0); + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#7c7c7c), color-stop(3%, #858585), color-stop(97%, #a4a4a4),to(#c2c2c2)); + -webkit-background-size: 57px; +} +li:first-child.store .image, .store:first-child a { + -webkit-border-top-left-radius: 8px 8px; +} +li:last-child.store .image, .store:last-child a { + -webkit-border-bottom-left-radius: 8px 8px; +} +.store .name, .applist .name { + font-size: 15px; + white-space: nowrap; + display: block; + overflow: hidden; + color: #000; + max-width: 60%; + text-overflow: ellipsis; + font-weight: bold; +} +.store .name { + position: absolute; + left: 95px; + top: 35px; +} +.applist .name { + position: absolute; + top: 27px; + left: 80px; + text-shadow: #eeeeee 0 1px 0; +} +.store .comment, .list .withimage .comment, .applist .comment, .applist .price { + font-size: 12px; + color: #7f7f7f; + display: block; + width: 60%; + font-weight: bold; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +.store .comment, .list .withimage .comment { + margin: 16px 0 0 95px; +} +.applist .comment { + position: absolute; + top: 9px; + left: 80px; + text-shadow: #eeeeee 0 1px 0; + color: #3b3b3b; +} +.applist .price { + position: absolute; + top: 29px; + right: 26px; + text-shadow: #eeeeee 0 1px 0; + text-align: right; + color: #3b3b3b; +} +.store .arrow, .list .withimage .arrow { + top: 39px!important; +} +.store .stars0, .store .stars1, .store .stars2, .store .stars3, .store .stars4, .store .stars5 { + position: absolute; + top: 56px; + left: 95px; + width: 65px; + height: 18px; + display: block!important; +} +.store .stars0 { + background: url('../images/0starsborder.png'); +} +.store .stars1 { + background: url('../images/1starsborder.png'); +} +.store .stars2 { + background: url('../images/2starsborder.png'); +} +.store .stars3 { + background: url('../images/3starsborder.png'); +} +.store .stars4 { + background: url('../images/4starsborder.png'); +} +.store .stars5, .applist .stars5 { + background: url('../images/5stars.png'); +} +.applist .stars0, .applist .stars1, .applist .stars2, .applist .stars3, .applist .stars4, .applist .stars5 { + position: absolute; + top: 46px; + left: 79px; + width: 65px; + height: 18px; + display: block!important; +} +.applist .stars0 { + background: url('../images/0stars.png'); +} +.applist .stars1 { + background: url('../images/1stars.png'); +} +.applist .stars2 { + background: url('../images/2stars.png'); +} +.applist .stars3 { + background: url('../images/3stars.png'); +} +.applist .stars4 { + background: url('../images/4stars.png'); +} +.applist .starcomment { + left: 147px; + top: 46px; + color: #3b3b3b; +} +.starcomment { + position: absolute; + left: 165px; + top: 56px; + font-size: 12px; + color: #7f7f7f; + font-weight: lighter; +} +.applist a:hover .name, .applist a:hover .starcomment, .applist a:hover .comment, .applist a:hover .price { + color: white; + text-shadow: none; +} +.graytitle { + position: relative; + font-weight: bold; + font-size: 17px; + right: 20px; + left: 9px; + color: #4C4C4C; + text-shadow: #FFF 0 1px 0; + padding: 1px 0 3px 8px; +} +.header { + display: block; + font-weight: bold; + color: rgb(73,102,145); + font-size: 12pt; + margin-bottom: 6px; + line-height: 14pt; +} +.musiclist ul, .ipodlist ul, .applist ul { + padding: 0; +} +.ipodlist ul { + margin: 0; +} +.musiclist li:nth-child(odd) { + background: #dddee0 +} +.applist li:nth-child(even) { + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#adadb0), color-stop(98%, #adadb0), to(#898a8d)) +} +.applist li:nth-child(odd) { + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#98989c), color-stop(98%, #98989c), to(#898a8d)) + +} +.ipodlist li:nth-child(even) { + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#414041), color-stop(3%, rgba(45,45,45,0.2)), to(rgba(45,45,45,0.2))) +} +.ipodlist li:nth-child(odd) { + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#414041), color-stop(3%, rgba(50,50,50,0.4)), to(rgba(50,50,50,0.4))) +} +.musiclist #content li, .ipodlist #content li, .applist #content li { + list-style: none; + width: auto; + position: relative; +} +.musiclist #content li { + height: 44px; + border-bottom: 1px solid #e6e6e6; +} +.applist #content li { + height: 70px; + margin-bottom: 1px; +} +.ipodlist #content li { + height: 42px; +} +.ipodlist #content { + background: -webkit-gradient(radial, 50% -70, 0, 50% 0, 200, from(#444444), to(rgb(13, 13, 13))); + top: 16px; +} +.musiclist #content li a, .ipodlist #content li a { + text-decoration: none; + color: #000; + width: 100%!important; + height: 100%; + display: block; +} +.applist #content li a { + text-decoration: none; + color: #000; + width: 100%; + height: 100%; + display: block; +} +.musiclist .number, .musiclist .name, .musiclist .time { + display: inline-block; + height: 44px; + font-weight: bold; + font-size: large; + width: 44px; + text-align: center; + line-height: 46px; +} +.musiclist .name { + margin-left: 0; + width: auto!important; + font-size: medium; + padding-left: 5px; + border-left: solid 1px #e6e6e6; +} +.musiclist .time { + color: #848484; + font-size: medium; + margin-left: 4px; + width: auto!important; + font-weight: normal; +} +.musiclist { + background-image: none!important; + background-color: #cbcccf; +} +.ipodlist { + background-image: none!important; + background-color: black; +} +.applist { + background-image: none!important; + background-color: #98989c; +} +.ipodlist span { + color: white; + font-weight: bold; + font-size: 14px; +} +.musiclist .name { + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; +} +.musiclist a:hover .name { + color: #0380f2; +} +.ipodlist .number { + width: 23px; + display: block; + float: left; + height: 42px; + margin-right: 3px; + text-align: right; + line-height: 43px; +} +.ipodlist .stop, .ipodlist .auto, .ipodlist .play { + width: 18px; + display: block; + float: left; + height: 10px; + text-align: right; + line-height: 43px; + margin-top: 16px; +} +.ipodlist .play { + background: url('../images/play.gif') no-repeat; +} +.ipodlist a:hover .auto, .ipodlist a:hover .play { + background: url('../images/play.gif') no-repeat; + background-position: 0 -10px; +} +.ipodlist .time { + width: 48px; + float: right; + border-left: solid #414041 1px; + display: block; + height: 42px; + text-align: center; + line-height: 43px; +} +.ipodlist .name { + display: block; + float: left; + width: inherit; + height: 42px; + text-overflow: ellipsis; + line-height: 42px; + padding-left: 5px; + overflow: hidden; + white-space: nowrap; + max-width: 62%; + border-left: solid #414041 1px; +} +.list .title { + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#a5b1ba), color-stop(3%, #909faa), color-stop(97%, #b5bfc6), to(#989ea4)); + height: 22px!important; + width: 100%; + color: #fff; + font-weight: bold; + font-size: 16px; + text-shadow: gray 0 1px 0; + line-height: 22px; + padding-left: 20px; + border-bottom: none!important; +} +.list ul { + background-color: #fff; + width: 100%; + overflow: hidden; + padding: 0; + margin: 0; +} +.list #content li { + height: 40px; + border-bottom: 1px solid #e1e1e1; + list-style: none; +} +.list { + background-color: #fff; + background-image: none!important; +} +.list #footer { + margin-top: 24px!important; +} +.ipodlist #footer { + margin-top: 48px!important; +} +.list #content li a { + padding: 9px 0 0 20px; + font-size: large; + font-weight: bold; + position: relative; + display: block; + color: #000; + text-decoration: none; + height: 32px; +} +.list #content li a .name { + text-overflow: ellipsis; + overflow: hidden; + max-width: 93%; + white-space: nowrap; + display: block; +} +.list #content li a:hover { + color: #fff; +} +.list #content { + margin-top: -13px!important; +} +.ipodlist #content, .musiclist #content, .applist #content { + margin-top: -29px!important; +} +.list ul img { + width: 90px; + height: 90px; + position: absolute; + left: 0; + top: 0; +} +.list .withimage { + height: 90px!important; +} +.list .withimage .name { + margin: 13px 0 0 90px; + text-overflow: ellipsis; + overflow: hidden; + max-width: 63%!important; + white-space: nowrap; +} +.list .withimage .comment { + margin: 10px auto auto 90px !important; + max-width: 63%!important; +} +.list .withimage a, .list .withimage:hover a { + height: 81px!important; +} +#leftnav, #leftbutton, #blueleftbutton { + position: absolute; + font-size: 12px; + left: 9px; + font-weight: bold; +} +#leftnav, #leftbutton, #rightnav, #rightbutton, #blueleftbutton, #bluerightbutton { + z-index: 5000; +} +#leftnav a, #rightnav a, #leftbutton a, #rightbutton a, #blueleftbutton a, #bluerightbutton a { + display: block; + color: #fff; + text-shadow: rgba(0,0,0,0.6) 0 -1px 0; + text-decoration: none; +} +.black #leftnav a:first-child, .transparent #leftnav a:first-child { + -webkit-border-image: url("../images/navleftblack.png") 0 5 0 13; +} +.black #leftnav a, .transparent #leftnav a { + -webkit-border-image: url("../images/navlinkleftblack.png") 0 5 0 13; +} +.black #rightnav a:first-child, .transparent #rightnav a:first-child { + -webkit-border-image: url("../images/navrightblack.png") 0 13 0 5; +} +.black #rightnav a, .transparent #rightnav a { + -webkit-border-image: url("../images/navlinkrightblack.png") 0 13 0 5; +} +.black #leftbutton a, .black #rightbutton a, .transparent #leftbutton a, .transparent #rightbutton a { + -webkit-border-image: url("../images/navbuttonblack.png") 0 5 0 5; +} +#leftnav a:first-child { + z-index: 2; + -webkit-border-image: url("../images/navleft.png") 0 5 0 13; + border-width: 0 5px 0 13px; + -webkit-border-top-left-radius: 16px; + -webkit-border-bottom-left-radius: 16px; + -webkit-border-top-right-radius: 6px; + -webkit-border-bottom-right-radius: 6px; + width: auto; +} +#leftnav a { + -webkit-border-image: url("../images/navlinkleft.png") 0 5 0 13; + z-index: 3; + margin-left: -4px; + border-width: 0 5px 0 13px; + padding-right: 4px; + -webkit-border-top-left-radius: 16px; + -webkit-border-bottom-left-radius: 16px; + -webkit-border-top-right-radius: 6px; + -webkit-border-bottom-right-radius: 6px; + float: left; +} +#rightnav, #rightbutton, #bluerightbutton { + position: absolute; + font-size: 12px; + right: 9px; + font-weight: bold; +} +#rightnav a { + -webkit-border-image: url("../images/navlinkright.png") 0 13 0 5; + z-index: 3; + margin-right: -4px; + border-width: 0 13px 0 5px; + padding-left: 4px; + -webkit-border-top-left-radius: 6px; + -webkit-border-bottom-left-radius: 6px; + float: right; + -webkit-border-top-right-radius: 16px; + -webkit-border-bottom-right-radius: 16px; +} +#rightnav a:first-child { + z-index: 2; + -webkit-border-top-left-radius: 6px; + -webkit-border-bottom-left-radius: 6px; + -webkit-border-image: url("../images/navright.png") 0 13 0 5; + border-width: 0 13px 0 5px; + -webkit-border-top-right-radius: 16px; + -webkit-border-bottom-right-radius: 16px; +} +#leftbutton a, #rightbutton a { + -webkit-border-image: url("../images/navbutton.png") 0 5 0 5; + border-width: 0 5px; + -webkit-border-radius: 6px; +} +#blueleftbutton a, #bluerightbutton a { + -webkit-border-image: url("../images/navbuttonblue.png") 0 5 0 5; + border-width: 0 5px; + -webkit-border-radius: 6px; +} +input[type="checkbox"] { + width: 94px; + height: 27px; + background: url('../images/checkbox.png'); + -webkit-appearance: none; + border: 0; + float: right; + margin: 8px 4px 0 0; +} +input[type="checkbox"]:checked { + background-position: 0 27px; +} +input[type="radio"] { + -webkit-appearance: none; + border: 0; + width: 100%; + height: 100%; + z-index: 2; + position: absolute; + left: 0; + margin: 0; + -webkit-border-radius: 0; +} +input[type="radio"]:checked { + background: url('../images/radiobutton.png') no-repeat; + background-position: right center; +} +.radiobutton .name { + z-index: 1; +} +select { + -webkit-appearance: none; + height: 100%; + width: 100%; + border: 0; +} +.select select { + -webkit-border-radius: 0; + color: #000; + font-weight: bold; + font-size: 17px; +} +.select option { + max-width: 90%; +} +.select .arrow { + background: url('../images/arrow.png'); + width: 8px; + height: 13px; + display: block; + -webkit-transform: rotate(90deg); + position: absolute; + right: 10px; + top: 18px; +} +.button input { + width: 100%; + height: 100%; + -webkit-appearance: none; + border: 0; + -webkit-border-radius: 0; + font-weight: bold; + font-size: 17px; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + background: none; +} +.textbox textarea { + padding: 0; + margin-top: 5px; + font-size: medium; +} +.bigfield input { + -webkit-appearance: none; + border: 0; + height: 100%; + padding: 0; + -webkit-border-radius: 0; + background: transparent; + font-weight: bold; + font-size: 17px; + padding-left: 5px; +} +.smallfield .name { + width: 48%; + position: absolute; + left: 0; + font-size: 17px; + text-overflow: ellipsis; + white-space: nowrap; + font-weight: bold; + line-height: 44px; + font-size: 17px; + padding-left: 5px; + overflow: hidden; +} +.smallfield input { + width: 50%; + position: absolute; + right: 0; + height: 44px; + -webkit-appearance: none; + border: none; + padding: 0; + background: transparent; + -webkit-border-radius: 0; + font-weight: bold; + font-size: 17px; +} +.smallfield:first-child input { + -webkit-border-top-right-radius: 8px; +} +.smallfield:last-child input { + -webkit-border-bottom-right-radius: 8px; +} diff --git a/mobile/apple/css/forms.css b/mobile/apple/css/forms.css new file mode 100644 index 0000000..d5d8145 --- /dev/null +++ b/mobile/apple/css/forms.css @@ -0,0 +1,72 @@ +.required { + color: #CC0000; +} + +.guidelines { + position:relative; + font-weight:normal; + font-size:14px; + right:20px; + left:9px; + color:#4C4C4C; + padding:1px 0 3px 8px; + margin: 0; + width:90%; +} + +.error +{ + position:relative; + font-weight:normal; + font-size:14px; + left:9px; + padding:1px 8px 3px 8px; + color:#CC0000 !important; + margin: 0; + width:90%; +} + +ul.error_message +{ + background-color:#FFDFDF !important; + border-color:#c7a9aa; +} + +ul.success_message +{ + background-color:#ccffcc !important; + border-color:#89ba8a; +} + +input.small +{ + width:25%; +} + +input.medium +{ + width:50%; +} + +input.large +{ + width:99%; +} + +textarea.small +{ + width:98%; + height:2.5em; +} + +textarea.medium +{ + width:98%; + height:5em; +} + +textarea.large +{ + width:98%; + height:7.5em; +} diff --git a/mobile/apple/css/style.css b/mobile/apple/css/style.css new file mode 100644 index 0000000..af839a2 --- /dev/null +++ b/mobile/apple/css/style.css @@ -0,0 +1 @@ +/*iWebKit css 5.04 by Christopher Plieger*/body{position:relative;margin:0;-webkit-text-size-adjust:none;min-height:416px;font-family:helvetica,sans-serif;-webkit-background-size:0.438em 100%;background:-webkit-gradient(linear,left top,right top,from(#c5ccd4),color-stop(71%, #c5ccd4),color-stop(72%, #cbd2d8),to(#cbd2d8));-webkit-touch-callout:none}.center{margin:auto;display:block;text-align:center!important}img{border:0}a:hover .arrow{background-position:0 -13px!important}@media screen and (max-width:320px){#topbar{height:44px}#title{line-height:44px;height:44px;font-size:16pt}#tributton a:first-child,#duobutton a:first-child{width:101px}#tributton a:last-child,#duobutton a:last-child{width:101px}#tributton a{width:106px}#duobutton .links{width:195px}#tributton .links{width:302px}#doublead{width:300px!important}#duoselectionbuttons{width:191px;height:30px;top:7px}#triselectionbuttons{width:290px;height:30px;top:7px}#triselectionbuttons a:first-child,#duoselectionbuttons a:first-child{width:99px;height:28px;line-height:28px}#triselectionbuttons a{width:98px;height:28px;line-height:28px}#triselectionbuttons a:last-child,#duoselectionbuttons a:last-child{width:99px;height:28px;line-height:28px}.searchbox form{width:272px}.searchbox input[type="text"]{width:275px}.menu .name{max-width:77%}.checkbox .name{max-width:190px}.radiobutton .name{max-width:190px}#leftnav a,#rightnav a,#leftbutton a,#rightbutton a,#blueleftbutton a,#bluerightbutton a{line-height:30px;height:30px}#leftnav img,#rightnav img{margin-top:4px}#leftnav,#leftbutton,#blueleftbutton{top:7px}#rightnav,#rightbutton,#bluerightbutton{top:7px}.musiclist .name{max-width:55%}.textbox textarea{width:280px}.bigfield input{width:295px}}@media screen and (min-width:321px){#topbar{height:32px}#title{line-height:32px;height:32px;font-size:13pt}.menu .name{max-width:85%}.checkbox .name{max-width:75%}.radiobutton .name{max-width:75%}#leftnav a,#rightnav a,#leftbutton a,#rightbutton a,#blueleftbutton a,#bluerightbutton a{line-height:24px;height:24px}#leftnav img,#rightnav img{margin-top:4px;height:70%}#leftnav,#leftbutton,#blueleftbutton{top:4px}#rightnav,#rightbutton,#bluerightbutton{top:4px}.musiclist .name{max-width:70%}.textbox textarea{width:440px}#tributton a:first-child,#duobutton a:first-child{width:152px}#tributton a:last-child,#duobutton a:last-child{width:152px}#tributton a{width:154px}#tributton .links{width:452px}#duobutton .links{width:298px}#doublead{width:350px!important}#duoselectionbuttons{width:293px;height:24px;top:4px}#triselectionbuttons{width:450px;height:24px;top:4px}#triselectionbuttons a:first-child,#duoselectionbuttons a:first-child{width:150px;height:22px;line-height:22px}#triselectionbuttons a{width:156px;height:22px;line-height:22px}#triselectionbuttons a:last-child,#duoselectionbuttons a:last-child{width:150px;height:22px;line-height:22px}.searchbox form{width:432px}.searchbox input[type="text"]{width:435px}.bigfield input{width:455px}}#topbar.black{background:-webkit-gradient(linear,0% 0%,0% 100%,from(#858585),color-stop(3%,#636363),color-stop(50%,#202020),color-stop(51%,black),color-stop(97%,black),to(#262626))}#topbar.transparent{background:-webkit-gradient(linear,0% 0%,0% 100%,from(rgba(133,133,133,0.7)),color-stop(3%,rgba(99,99,99,0.7)),color-stop(50%,rgba(32,32,32,0.7)),color-stop(51%,rgba(0,0,0,0.7)),color-stop(97%,rgba(0,0,0,0.7)),to(rgba(38,38,38,0.7)))}#topbar{position:relative;left:0;top:0;width:auto;background:-webkit-gradient(linear,0% 0%,0% 100%,from(#cdd5df),color-stop(3%,#b0bccd),color-stop(50%,#889bb3),color-stop(51%,#8195af),color-stop(97%,#6d84a2),to(#2d3642));margin-bottom:13px}#title{position:absolute;font-weight:bold;top:0;left:0;right:0;padding:0 10px;text-align:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;color:#FFF;text-shadow:rgba(0,0,0,0.6) 0 -1px 0}#content{width:100%;position:relative;min-height:250px;margin-top:10px;height:auto;z-index:0;overflow:hidden}#footer{text-align:center;position:relative;margin:20px 10px 0;height:auto;width:auto;bottom:10px}.ipodlist #footer,.ipodlist #footer a{text-shadow:#FFF 0 -1px 0}#footer a,#footer{text-decoration:none;font-size:9pt;color:#4C4C4C;text-shadow:#FFF 0 1px 0}.pageitem{-webkit-border-radius:8px;background-color:#fff;border:#878787 solid 1px;font-size:12pt;overflow:hidden;padding:0;position:relative;display:block;height:auto;width:auto;margin:3px 9px 17px;list-style:none}.textbox{padding:5px 9px;position:relative;overflow:hidden;border-top:1px solid #878787}#tributton,#duobutton{height:44px;background:-webkit-gradient(linear,0% 0%,0% 100%,from(#cdd4d9),color-stop(3%,#c0c9cf),color-stop(97%,#abb7bf),to(#81929f));margin:-13px 0 13px 0;text-align:center}#tributton .links,#duobutton .links{height:30px;-webkit-border-image:url("../images/tributton.png") 0 4 0 4;border-width:0 4px 0 4px;margin:0 auto 0px auto;position:relative;top:7px}#tributton a:first-child,#duobutton a:first-child{border-right:1px solid #6d7e91;-webkit-border-top-left-radius:5px;-webkit-border-bottom-left-radius:5px;margin-left:-4px}#tributton a,#duobutton a{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;height:27px;display:inline-block;line-height:27px;margin-top:1px;font:bold 13px;text-decoration:none;color:#3f5c84;text-shadow:#FFF 0 1px 0}#duobutton a:last-child{border:0}#tributton a:last-child{border-left:1px solid #6d7e91}#tributton a:last-child,#duobutton a:last-child{-webkit-border-top-right-radius:5px;-webkit-border-bottom-right-radius:5px;margin-right:-4px}#tributton a:hover,#tributton a#pressed,#duobutton a:hover,#duobutton a#pressed{background:-webkit-gradient(linear,0% 0%,0% 100%,from(#7b8b9f),color-stop(3%,#8c9baf),to(#647792));color:white;text-shadow:black 0 -1px 0}#triselectionbuttons,#duoselectionbuttons{-webkit-border-image:url('../images/navbutton.png') 0 5 0 5;border-width:0 5px 0 5px;position:relative;margin:auto}#duoselectionbuttons a:first-child{border:0}#triselectionbuttons a:first-child{border-right:solid 1px #556984}#triselectionbuttons a:first-child,#duoselectionbuttons a:first-child{margin-left:-4px;-webkit-border-top-left-radius:6px;-webkit-border-bottom-left-radius:6px}#triselectionbuttons a,#duoselectionbuttons a{display:inline-block;text-align:center;color:white;text-decoration:none;margin-top:1px;text-shadow:black 0 -1px 0;background:-webkit-gradient(linear,0% 0%,0% 100%,from(#909baa),color-stop(3%,#a5b4c6),color-stop(50%,#798eaa),color-stop(51%,#6b83a1),color-stop(97%,#6e85a3),to(#526379))}#triselectionbuttons a:last-child,#duoselectionbuttons a:last-child{border-left:solid 1px #556984;margin-right:-4px;-webkit-border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px}#triselectionbuttons a:hover,#triselectionbuttons a#pressed,#duoselectionbuttons a:hover,#duoselectionbuttons a#pressed{background:none}#doublead{height:83px!important;position:relative;margin:0 auto 13px auto}#doublead a:first-child{left:0!important}#doublead a:last-child{right:0!important}#doublead a{width:147px!important;height:83px!important;position:absolute;-webkit-border-radius:8px;display:block;background:-webkit-gradient(linear,0% 0%,0% 100%,from(#7c7c7c),color-stop(3%,#858585),color-stop(97%,#a4a4a4),to(#c2c2c2))}li#doublead{margin-top:25px;margin-bottom:10px!important;background:none}li#doublead:hover{background:none}.searchbox{height:44px;background:-webkit-gradient(linear,0% 0%,0% 100%,from(#f1f3f4),color-stop(3%,#e0e4e7),color-stop(50%,#c7cfd4),color-stop(51%,#bec7cd),color-stop(97%,#b4bec6),to(#8999a5));margin:-13px 0 13px 0;width:100%}.searchbox form{height:24px;-webkit-border-image:url('../images/searchfield.png') 4 14 1 24;border-width:4px 14px 1px 24px;display:block;position:relative;top:8px;margin:auto}fieldset{border:0;margin:0;padding:0}.searchbox input[type="text"]{border:0;-webkit-appearance:none;height:18px;float:left;font-size:13px;padding:0;position:relative;top:2px;left:2px}.textbox img{max-width:100%}.textbox p{margin-top:2px}.textbox p{margin-top:2px;color:#000;margin-bottom:2px;text-align:justify}.textbox img{max-width:100%}.textbox ul{margin:3px 0 3px 0;list-style:circle!important}.textbox li{margin:0!important}.pageitem li:first-child,.pageitem li.form:first-child{border-top:0}.menu,.checkbox,.radiobutton,.select,li.button,li.bigfield,li.smallfield{position:relative;list-style-type:none;display:block;height:43px;overflow:hidden;border-top:1px solid #878787;width:auto}.pageitem li:first-child:hover,.pageitem li:first-child a,.radiobutton:first-child input,.select:first-child select,li.button:first-child input,.bigfield:first-child input{-webkit-border-top-left-radius:8px;-webkit-border-top-right-radius:8px}.pageitem li:last-child:hover,.pageitem li:last-child a,.radiobutton:last-child input,.select:last-child select,li.button:last-child input,.bigfield:last-child input{-webkit-border-bottom-left-radius:8px;-webkit-border-bottom-right-radius:8px}.menu:hover,.store:hover,.list #content li a:hover,.list .withimage:hover,.applist li:hover:nth-child(n),.ipodlist li:hover:nth-child(n){background:-webkit-gradient(linear,0% 0%,0% 100%,from(#058cf5),to(#015fe6))}.ipodlist li:hover:nth-child(n) .name,.ipodlist li:hover:nth-child(n) .time{border:0}.menu a:hover .name,.store:hover .starcomment,.store:hover .name,.store:hover .comment,.list .withimage a:hover .comment{color:#fff}.menu a:hover .comment{color:#CCF}.menu a{display:block;height:43px;width:auto;text-decoration:none}.menu a img{width:auto;height:32px;margin:5px 0 0 5px;float:left}.menu .name,.checkbox .name,.radiobutton .name{margin:11px 0 0 7px;width:auto;color:#000;font-weight:bold;font-size:17px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;float:left}.menu .comment{margin:11px 30px 0 0;width:auto;font-size:17px;text-overflow:ellipsis;overflow:hidden;max-width:75%;white-space:nowrap;float:right;color:#324f85}.menu .arrow,.store .arrow,.musiclist .arrow,.list .arrow{position:absolute;width:8px!important;height:13px!important;right:10px;top:15px;margin:0!important;background:url("../images/arrow.png") 0 0 no-repeat}.applist .arrow{position:absolute;width:8px!important;height:13px!important;right:10px;top:29px;margin:0!important;background:url("../images/arrow.png") 0 0 no-repeat}.store{height:90px;border-top:#878787 solid 1px;overflow:hidden;position:relative}.store a{width:100%;height:90px;display:block;text-decoration:none;position:absolute}.store .image{position:absolute;left:0;top:0;height:90px;width:90px;display:block;background:-webkit-gradient(linear,0% 0%,0% 100%,from(#eff1f5),to(#d6dce6));-webkit-background-size:90px}.applist .image{width:57px;height:57px;display:block;position:absolute;top:7px;left:11px;-webkit-border-radius:8px;-webkit-box-shadow:0 2px 3px rgb(0,0,0);background:-webkit-gradient(linear,0% 0%,0% 100%,from(#7c7c7c),color-stop(3%,#858585),color-stop(97%,#a4a4a4),to(#c2c2c2));-webkit-background-size:57px}li:first-child.store .image,.store:first-child a{-webkit-border-top-left-radius:8px 8px}li:last-child.store .image,.store:last-child a{-webkit-border-bottom-left-radius:8px 8px}.store .name,.applist .name{font-size:15px;white-space:nowrap;display:block;overflow:hidden;color:#000;max-width:60%;text-overflow:ellipsis;font-weight:bold}.store .name{position:absolute;left:95px;top:35px}.applist .name{position:absolute;top:27px;left:80px;text-shadow:#eee 0 1px 0}.store .comment,.list .withimage .comment,.applist .comment,.applist .price{font-size:12px;color:#7f7f7f;display:block;width:60%;font-weight:bold;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.store .comment,.list .withimage .comment{margin:16px 0 0 95px}.applist .comment{position:absolute;top:9px;left:80px;text-shadow:#eee 0 1px 0;color:#3b3b3b}.applist .price{position:absolute;top:29px;right:26px;text-shadow:#eee 0 1px 0;text-align:right;color:#3b3b3b}.store .arrow,.list .withimage .arrow{top:39px!important}.store .stars0,.store .stars1,.store .stars2,.store .stars3,.store .stars4,.store .stars5{position:absolute;top:56px;left:95px;width:65px;height:18px;display:block!important}.store .stars0{background:url('../images/0starsborder.png')}.store .stars1{background:url('../images/1starsborder.png')}.store .stars2{background:url('../images/2starsborder.png')}.store .stars3{background:url('../images/3starsborder.png')}.store .stars4{background:url('../images/4starsborder.png')}.store .stars5,.applist .stars5{background:url('../images/5stars.png')}.applist .stars0,.applist .stars1,.applist .stars2,.applist .stars3,.applist .stars4,.applist .stars5{position:absolute;top:46px;left:79px;width:65px;height:18px;display:block!important}.applist .stars0{background:url('../images/0stars.png')}.applist .stars1{background:url('../images/1stars.png')}.applist .stars2{background:url('../images/2stars.png')}.applist .stars3{background:url('../images/3stars.png')}.applist .stars4{background:url('../images/4stars.png')}.applist .starcomment{left:147px;top:46px;color:#3b3b3b}.starcomment{position:absolute;left:165px;top:56px;font-size:12px;color:#7f7f7f;font-weight:lighter}.applist a:hover .name,.applist a:hover .starcomment,.applist a:hover .comment,.applist a:hover .price{color:white;text-shadow:none}.graytitle{position:relative;font-weight:bold;font-size:17px;right:20px;left:9px;color:#4C4C4C;text-shadow:#FFF 0 1px 0;padding:1px 0 3px 8px}.header{display:block;font-weight:bold;color:rgb(73,102,145);font-size:12pt;margin-bottom:6px;line-height:14pt}.musiclist ul,.ipodlist ul,.applist ul{padding:0}.ipodlist ul{margin:0}.musiclist li:nth-child(odd){background:#dddee0}.applist li:nth-child(even){background:-webkit-gradient(linear,0% 0%,0% 100%,from(#adadb0),color-stop(98%,#adadb0),to(#898a8d))}.applist li:nth-child(odd){background:-webkit-gradient(linear,0% 0%,0% 100%,from(#98989c),color-stop(98%,#98989c),to(#898a8d))}.ipodlist li:nth-child(even){background:-webkit-gradient(linear,0% 0%,0% 100%,from(#414041),color-stop(3%,rgba(45,45,45,0.2)),to(rgba(45,45,45,0.2)))}.ipodlist li:nth-child(odd){background:-webkit-gradient(linear,0% 0%,0% 100%,from(#414041),color-stop(3%,rgba(50,50,50,0.4)),to(rgba(50,50,50,0.4)))}.musiclist #content li,.ipodlist #content li,.applist #content li{list-style:none;width:auto;position:relative}.musiclist #content li{height:44px;border-bottom:1px solid #e6e6e6}.applist #content li{height:70px;margin-bottom:1px}.ipodlist #content li{height:42px}.ipodlist #content{background:-webkit-gradient(radial,50% -70,0,50% 0,200,from(#444),to(rgb(13,13,13)));top:16px}.musiclist #content li a,.ipodlist #content li a{text-decoration:none;color:#000;width:100%!important;height:100%;display:block}.applist #content li a{text-decoration:none;color:#000;width:100%;height:100%;display:block}.musiclist .number,.musiclist .name,.musiclist .time{display:inline-block;height:44px;font-weight:bold;font-size:large;width:44px;text-align:center;line-height:46px}.musiclist .name{margin-left:0;width:auto!important;font-size:medium;padding-left:5px;border-left:solid 1px #e6e6e6}.musiclist .time{color:#848484;font-size:medium;margin-left:4px;width:auto!important;font-weight:normal}.musiclist{background-image:none!important;background-color:#cbcccf}.ipodlist{background-image:none!important;background-color:black}.applist{background-image:none!important;background-color:#98989c}.ipodlist span{color:white;font-weight:bold;font-size:14px}.musiclist .name{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.musiclist a:hover .name{color:#0380f2}.ipodlist .number{width:23px;display:block;float:left;height:42px;margin-right:3px;text-align:right;line-height:43px}.ipodlist .stop,.ipodlist .auto,.ipodlist .play{width:18px;display:block;float:left;height:10px;text-align:right;line-height:43px;margin-top:16px}.ipodlist .play{background:url('../images/play.gif') no-repeat}.ipodlist a:hover .auto,.ipodlist a:hover .play{background:url('../images/play.gif') no-repeat;background-position:0 -10px}.ipodlist .time{width:48px;float:right;border-left:solid #414041 1px;display:block;height:42px;text-align:center;line-height:43px}.ipodlist .name{display:block;float:left;width:inherit;height:42px;text-overflow:ellipsis;line-height:42px;padding-left:5px;overflow:hidden;white-space:nowrap;max-width:62%;border-left:solid #414041 1px}.list .title{background:-webkit-gradient(linear,0% 0%,0% 100%,from(#a5b1ba),color-stop(3%,#909faa),color-stop(97%,#b5bfc6),to(#989ea4));height:22px!important;width:100%;color:#fff;font-weight:bold;font-size:16px;text-shadow:gray 0 1px 0;line-height:22px;padding-left:20px;border-bottom:none!important}.list ul{background-color:#fff;width:100%;overflow:hidden;padding:0;margin:0}.list #content li{height:40px;border-bottom:1px solid #e1e1e1;list-style:none}.list{background-color:#fff;background-image:none!important}.list #footer{margin-top:24px!important}.ipodlist #footer{margin-top:48px!important}.list #content li a{padding:9px 0 0 20px;font-size:large;font-weight:bold;position:relative;display:block;color:#000;text-decoration:none;height:32px}.list #content li a .name{text-overflow:ellipsis;overflow:hidden;max-width:93%;white-space:nowrap;display:block}.list #content li a:hover{color:#fff}.list #content{margin-top:-13px!important}.ipodlist #content,.musiclist #content,.applist #content{margin-top:-29px!important}.list ul img{width:90px;height:90px;position:absolute;left:0;top:0}.list .withimage{height:90px!important}.list .withimage .name{margin:13px 0 0 90px;text-overflow:ellipsis;overflow:hidden;max-width:63%!important;white-space:nowrap}.list .withimage .comment{margin:10px auto auto 90px !important;max-width:63%!important}.list .withimage a,.list .withimage:hover a{height:81px!important}#leftnav,#leftbutton,#blueleftbutton{position:absolute;font-size:12px;left:9px;font-weight:bold}#leftnav,#leftbutton,#rightnav,#rightbutton,#blueleftbutton,#bluerightbutton{z-index:5000}#leftnav a,#rightnav a,#leftbutton a,#rightbutton a,#blueleftbutton a,#bluerightbutton a{display:block;color:#fff;text-shadow:rgba(0,0,0,0.6) 0 -1px 0;text-decoration:none}.black #leftnav a:first-child,.transparent #leftnav a:first-child{-webkit-border-image:url("../images/navleftblack.png") 0 5 0 13}.black #leftnav a,.transparent #leftnav a{-webkit-border-image:url("../images/navlinkleftblack.png") 0 5 0 13}.black #rightnav a:first-child,.transparent #rightnav a:first-child{-webkit-border-image:url("../images/navrightblack.png") 0 13 0 5}.black #rightnav a,.transparent #rightnav a{-webkit-border-image:url("../images/navlinkrightblack.png") 0 13 0 5}.black #leftbutton a,.black #rightbutton a,.transparent #leftbutton a,.transparent #rightbutton a{-webkit-border-image:url("../images/navbuttonblack.png") 0 5 0 5}#leftnav a:first-child{z-index:2;-webkit-border-image:url("../images/navleft.png") 0 5 0 13;border-width:0 5px 0 13px;-webkit-border-top-left-radius:16px;-webkit-border-bottom-left-radius:16px;-webkit-border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;width:auto}#leftnav a{-webkit-border-image:url("../images/navlinkleft.png") 0 5 0 13;z-index:3;margin-left:-4px;border-width:0 5px 0 13px;padding-right:4px;-webkit-border-top-left-radius:16px;-webkit-border-bottom-left-radius:16px;-webkit-border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;float:left}#rightnav,#rightbutton,#bluerightbutton{position:absolute;font-size:12px;right:9px;font-weight:bold}#rightnav a{-webkit-border-image:url("../images/navlinkright.png") 0 13 0 5;z-index:3;margin-right:-4px;border-width:0 13px 0 5px;padding-left:4px;-webkit-border-top-left-radius:6px;-webkit-border-bottom-left-radius:6px;float:right;-webkit-border-top-right-radius:16px;-webkit-border-bottom-right-radius:16px}#rightnav a:first-child{z-index:2;-webkit-border-top-left-radius:6px;-webkit-border-bottom-left-radius:6px;-webkit-border-image:url("../images/navright.png") 0 13 0 5;border-width:0 13px 0 5px;-webkit-border-top-right-radius:16px;-webkit-border-bottom-right-radius:16px}#leftbutton a,#rightbutton a{-webkit-border-image:url("../images/navbutton.png") 0 5 0 5;border-width:0 5px;-webkit-border-radius:6px}#blueleftbutton a,#bluerightbutton a{-webkit-border-image:url("../images/navbuttonblue.png") 0 5 0 5;border-width:0 5px;-webkit-border-radius:6px}input[type="checkbox"]{width:94px;height:27px;background:url('../images/checkbox.png');-webkit-appearance:none;border:0;float:right;margin:8px 4px 0 0}input[type="checkbox"]:checked{background-position:0 27px}input[type="radio"]{-webkit-appearance:none;border:0;width:100%;height:100%;z-index:2;position:absolute;left:0;margin:0;-webkit-border-radius:0}input[type="radio"]:checked{background:url('../images/radiobutton.png') no-repeat;background-position:right center}.radiobutton .name{z-index:1}select{-webkit-appearance:none;height:100%;width:100%;border:0}.select select{-webkit-border-radius:0;color:#000;font-weight:bold;font-size:17px}.select option{max-width:90%}.select .arrow{background:url('../images/arrow.png');width:8px;height:13px;display:block;-webkit-transform:rotate(90deg);position:absolute;right:10px;top:18px}.button input{width:100%;height:100%;-webkit-appearance:none;border:0;-webkit-border-radius:0;font-weight:bold;font-size:17px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;background:none}.textbox textarea{padding:0;margin-top:5px;font-size:medium}.bigfield input{-webkit-appearance:none;border:0;height:100%;padding:0;-webkit-border-radius:0;background:transparent;font-weight:bold;font-size:17px;padding-left:5px}.smallfield .name{width:48%;position:absolute;left:0;font-size:17px;text-overflow:ellipsis;white-space:nowrap;font-weight:bold;line-height:44px;font-size:17px;padding-left:5px;overflow:hidden}.smallfield input{width:50%;position:absolute;right:0;height:44px;-webkit-appearance:none;border:none;padding:0;background:transparent;-webkit-border-radius:0;font-weight:bold;font-size:17px}.smallfield:first-child input{-webkit-border-top-right-radius:8px}.smallfield:last-child input{-webkit-border-bottom-right-radius:8px} \ No newline at end of file diff --git a/mobile/apple/images/0stars.png b/mobile/apple/images/0stars.png new file mode 100644 index 0000000..81947f7 Binary files /dev/null and b/mobile/apple/images/0stars.png differ diff --git a/mobile/apple/images/0starsborder.png b/mobile/apple/images/0starsborder.png new file mode 100644 index 0000000..f4d2314 Binary files /dev/null and b/mobile/apple/images/0starsborder.png differ diff --git a/mobile/apple/images/1stars.png b/mobile/apple/images/1stars.png new file mode 100644 index 0000000..12dd9c6 Binary files /dev/null and b/mobile/apple/images/1stars.png differ diff --git a/mobile/apple/images/1starsborder.png b/mobile/apple/images/1starsborder.png new file mode 100644 index 0000000..ad21998 Binary files /dev/null and b/mobile/apple/images/1starsborder.png differ diff --git a/mobile/apple/images/2stars.png b/mobile/apple/images/2stars.png new file mode 100644 index 0000000..fa7e2b9 Binary files /dev/null and b/mobile/apple/images/2stars.png differ diff --git a/mobile/apple/images/2starsborder.png b/mobile/apple/images/2starsborder.png new file mode 100644 index 0000000..10a2b91 Binary files /dev/null and b/mobile/apple/images/2starsborder.png differ diff --git a/mobile/apple/images/3stars.png b/mobile/apple/images/3stars.png new file mode 100644 index 0000000..7136c3f Binary files /dev/null and b/mobile/apple/images/3stars.png differ diff --git a/mobile/apple/images/3starsborder.png b/mobile/apple/images/3starsborder.png new file mode 100644 index 0000000..22c5a92 Binary files /dev/null and b/mobile/apple/images/3starsborder.png differ diff --git a/mobile/apple/images/4stars.png b/mobile/apple/images/4stars.png new file mode 100644 index 0000000..0714156 Binary files /dev/null and b/mobile/apple/images/4stars.png differ diff --git a/mobile/apple/images/4starsborder.png b/mobile/apple/images/4starsborder.png new file mode 100644 index 0000000..4a17cee Binary files /dev/null and b/mobile/apple/images/4starsborder.png differ diff --git a/mobile/apple/images/5stars.png b/mobile/apple/images/5stars.png new file mode 100644 index 0000000..370c60b Binary files /dev/null and b/mobile/apple/images/5stars.png differ diff --git a/mobile/apple/images/arrow.png b/mobile/apple/images/arrow.png new file mode 100644 index 0000000..9993a06 Binary files /dev/null and b/mobile/apple/images/arrow.png differ diff --git a/mobile/apple/images/checkbox.png b/mobile/apple/images/checkbox.png new file mode 100644 index 0000000..75f0ede Binary files /dev/null and b/mobile/apple/images/checkbox.png differ diff --git a/mobile/apple/images/home.png b/mobile/apple/images/home.png new file mode 100644 index 0000000..0fc49fc Binary files /dev/null and b/mobile/apple/images/home.png differ diff --git a/mobile/apple/images/navbutton.png b/mobile/apple/images/navbutton.png new file mode 100644 index 0000000..c786de4 Binary files /dev/null and b/mobile/apple/images/navbutton.png differ diff --git a/mobile/apple/images/navbuttonblack.png b/mobile/apple/images/navbuttonblack.png new file mode 100644 index 0000000..b7a9bab Binary files /dev/null and b/mobile/apple/images/navbuttonblack.png differ diff --git a/mobile/apple/images/navbuttonblue.png b/mobile/apple/images/navbuttonblue.png new file mode 100644 index 0000000..97a2c98 Binary files /dev/null and b/mobile/apple/images/navbuttonblue.png differ diff --git a/mobile/apple/images/navleft.png b/mobile/apple/images/navleft.png new file mode 100644 index 0000000..a6c05dd Binary files /dev/null and b/mobile/apple/images/navleft.png differ diff --git a/mobile/apple/images/navleftblack.png b/mobile/apple/images/navleftblack.png new file mode 100644 index 0000000..e1eb70f Binary files /dev/null and b/mobile/apple/images/navleftblack.png differ diff --git a/mobile/apple/images/navlinkleft.png b/mobile/apple/images/navlinkleft.png new file mode 100644 index 0000000..5e59302 Binary files /dev/null and b/mobile/apple/images/navlinkleft.png differ diff --git a/mobile/apple/images/navlinkleftblack.png b/mobile/apple/images/navlinkleftblack.png new file mode 100644 index 0000000..82d1022 Binary files /dev/null and b/mobile/apple/images/navlinkleftblack.png differ diff --git a/mobile/apple/images/navlinkright.png b/mobile/apple/images/navlinkright.png new file mode 100644 index 0000000..df5131f Binary files /dev/null and b/mobile/apple/images/navlinkright.png differ diff --git a/mobile/apple/images/navlinkrightblack.png b/mobile/apple/images/navlinkrightblack.png new file mode 100644 index 0000000..ef55084 Binary files /dev/null and b/mobile/apple/images/navlinkrightblack.png differ diff --git a/mobile/apple/images/navright.png b/mobile/apple/images/navright.png new file mode 100644 index 0000000..afa269d Binary files /dev/null and b/mobile/apple/images/navright.png differ diff --git a/mobile/apple/images/navrightblack.png b/mobile/apple/images/navrightblack.png new file mode 100644 index 0000000..80c5b83 Binary files /dev/null and b/mobile/apple/images/navrightblack.png differ diff --git a/mobile/apple/images/play.gif b/mobile/apple/images/play.gif new file mode 100644 index 0000000..7447d05 Binary files /dev/null and b/mobile/apple/images/play.gif differ diff --git a/mobile/apple/images/radiobutton.png b/mobile/apple/images/radiobutton.png new file mode 100644 index 0000000..45e68fd Binary files /dev/null and b/mobile/apple/images/radiobutton.png differ diff --git a/mobile/apple/images/searchfield.png b/mobile/apple/images/searchfield.png new file mode 100644 index 0000000..05eb98a Binary files /dev/null and b/mobile/apple/images/searchfield.png differ diff --git a/mobile/apple/images/tributton.png b/mobile/apple/images/tributton.png new file mode 100644 index 0000000..f5c8f55 Binary files /dev/null and b/mobile/apple/images/tributton.png differ diff --git a/mobile/apple/javascript/developer-functions.js b/mobile/apple/javascript/developer-functions.js new file mode 100644 index 0000000..09a1059 --- /dev/null +++ b/mobile/apple/javascript/developer-functions.js @@ -0,0 +1,29 @@ +var iWebkit; + +if (!iWebkit) { + + iWebkit = window.onload = function () { + function fullscreen() { + var a = document.getElementsByTagName("a"); + for (var i = 0; i < a.length;i++) { + if (a[i].className.match("noeffect")) { + } + else { + a[i].onclick = function () { + window.location = this.getAttribute("href"); + return false; + }; + } + } + } + + function hideURLbar() { + window.scrollTo(0, 0.9); + } + iWebkit.init = function () { + fullscreen(); + hideURLbar(); + }; + iWebkit.init(); + }; +} \ No newline at end of file diff --git a/mobile/apple/javascript/functions.js b/mobile/apple/javascript/functions.js new file mode 100644 index 0000000..c9cbea8 --- /dev/null +++ b/mobile/apple/javascript/functions.js @@ -0,0 +1 @@ +var iWebkit;if(!iWebkit){iWebkit=window.onload=function(){function fullscreen(){var a=document.getElementsByTagName("a");for(var i=0;i "http://purl.org/rss/1.0/modules/content/", + "wfw" => "http://wellformedweb.org/CommentAPI/", + "dc" => "http://purl.org/dc/elements/1.1/" +); +// obtain the articles in the feeds, and construct an array of articles + +$articles = array(); + +// step 1: get the feed +$blog_url = "HTTP://YOURSITE.COM/FEED.XML"; + +$rawFeed = file_get_contents($blog_url); +$xml = new SimpleXmlElement($rawFeed); + +// step 2: extract the channel metadata + +$channel = array(); +$channel["title"] = $xml->channel->title; +$channel["link"] = $xml->channel->link; +$channel["description"] = $xml->channel->description; +$channel["pubDate"] = $xml->pubDate; +$channel["timestamp"] = strtotime($xml->pubDate); +$channel["generator"] = $xml->generator; +$channel["language"] = $xml->language; + +// step 3: extract the articles + +foreach ($xml->channel->item as $item) +{ + $article = array(); + $article["channel"] = $blog_url; + ?> + comments; + $article["timestamp"] = strtotime($item->pubDate); + ?> + +guid["isPermaLink"]; + + // get data held in namespaces + $content = $item->children($ns["content"]); + $dc = $item->children($ns["dc"]); + $wfw = $item->children($ns["wfw"]); + + + foreach ($dc->subject as $subject) + $article["subject"][] = (string)$subject; + + $article["content"] = (string)trim($content->encoded); + $article["commentRss"] = $wfw->commentRss; + + // add this article to the list + $articles[$article["timestamp"]] = $article; +} + +// at this point, $channel contains all the metadata about the RSS feed, +// and $articles contains an array of articles for us to repurpose + + + + ?> \ No newline at end of file diff --git a/mobile/apple/thumbs/accessibility.png b/mobile/apple/thumbs/accessibility.png new file mode 100644 index 0000000..6478c8b Binary files /dev/null and b/mobile/apple/thumbs/accessibility.png differ diff --git a/mobile/apple/thumbs/appstore.png b/mobile/apple/thumbs/appstore.png new file mode 100644 index 0000000..4a1be06 Binary files /dev/null and b/mobile/apple/thumbs/appstore.png differ diff --git a/mobile/apple/thumbs/basics.png b/mobile/apple/thumbs/basics.png new file mode 100644 index 0000000..5305ea3 Binary files /dev/null and b/mobile/apple/thumbs/basics.png differ diff --git a/mobile/apple/thumbs/calculator.png b/mobile/apple/thumbs/calculator.png new file mode 100644 index 0000000..4d61678 Binary files /dev/null and b/mobile/apple/thumbs/calculator.png differ diff --git a/mobile/apple/thumbs/calendar.png b/mobile/apple/thumbs/calendar.png new file mode 100644 index 0000000..e6e5591 Binary files /dev/null and b/mobile/apple/thumbs/calendar.png differ diff --git a/mobile/apple/thumbs/calendar2.png b/mobile/apple/thumbs/calendar2.png new file mode 100644 index 0000000..9c55422 Binary files /dev/null and b/mobile/apple/thumbs/calendar2.png differ diff --git a/mobile/apple/thumbs/camera.png b/mobile/apple/thumbs/camera.png new file mode 100644 index 0000000..9b808a5 Binary files /dev/null and b/mobile/apple/thumbs/camera.png differ diff --git a/mobile/apple/thumbs/clock.png b/mobile/apple/thumbs/clock.png new file mode 100644 index 0000000..801c6cb Binary files /dev/null and b/mobile/apple/thumbs/clock.png differ diff --git a/mobile/apple/thumbs/compass.png b/mobile/apple/thumbs/compass.png new file mode 100644 index 0000000..66533d3 Binary files /dev/null and b/mobile/apple/thumbs/compass.png differ diff --git a/mobile/apple/thumbs/contacts.png b/mobile/apple/thumbs/contacts.png new file mode 100644 index 0000000..76ae042 Binary files /dev/null and b/mobile/apple/thumbs/contacts.png differ diff --git a/mobile/apple/thumbs/help.png b/mobile/apple/thumbs/help.png new file mode 100644 index 0000000..0f53e27 Binary files /dev/null and b/mobile/apple/thumbs/help.png differ diff --git a/mobile/apple/thumbs/ipod.png b/mobile/apple/thumbs/ipod.png new file mode 100644 index 0000000..f03c7b0 Binary files /dev/null and b/mobile/apple/thumbs/ipod.png differ diff --git a/mobile/apple/thumbs/itunes.png b/mobile/apple/thumbs/itunes.png new file mode 100644 index 0000000..ab77534 Binary files /dev/null and b/mobile/apple/thumbs/itunes.png differ diff --git a/mobile/apple/thumbs/iwebkit.png b/mobile/apple/thumbs/iwebkit.png new file mode 100644 index 0000000..7b5fb3d Binary files /dev/null and b/mobile/apple/thumbs/iwebkit.png differ diff --git a/mobile/apple/thumbs/mail.png b/mobile/apple/thumbs/mail.png new file mode 100644 index 0000000..4297005 Binary files /dev/null and b/mobile/apple/thumbs/mail.png differ diff --git a/mobile/apple/thumbs/maps.png b/mobile/apple/thumbs/maps.png new file mode 100644 index 0000000..9f517e3 Binary files /dev/null and b/mobile/apple/thumbs/maps.png differ diff --git a/mobile/apple/thumbs/messages.png b/mobile/apple/thumbs/messages.png new file mode 100644 index 0000000..1a7879a Binary files /dev/null and b/mobile/apple/thumbs/messages.png differ diff --git a/mobile/apple/thumbs/music.png b/mobile/apple/thumbs/music.png new file mode 100644 index 0000000..83a2131 Binary files /dev/null and b/mobile/apple/thumbs/music.png differ diff --git a/mobile/apple/thumbs/nike+.png b/mobile/apple/thumbs/nike+.png new file mode 100644 index 0000000..673d59d Binary files /dev/null and b/mobile/apple/thumbs/nike+.png differ diff --git a/mobile/apple/thumbs/notepad.png b/mobile/apple/thumbs/notepad.png new file mode 100644 index 0000000..3f38062 Binary files /dev/null and b/mobile/apple/thumbs/notepad.png differ diff --git a/mobile/apple/thumbs/other.png b/mobile/apple/thumbs/other.png new file mode 100644 index 0000000..b684969 Binary files /dev/null and b/mobile/apple/thumbs/other.png differ diff --git a/mobile/apple/thumbs/otherapps.png b/mobile/apple/thumbs/otherapps.png new file mode 100644 index 0000000..a8fbb14 Binary files /dev/null and b/mobile/apple/thumbs/otherapps.png differ diff --git a/mobile/apple/thumbs/photos.png b/mobile/apple/thumbs/photos.png new file mode 100644 index 0000000..2c801e0 Binary files /dev/null and b/mobile/apple/thumbs/photos.png differ diff --git a/mobile/apple/thumbs/plugin.png b/mobile/apple/thumbs/plugin.png new file mode 100644 index 0000000..dc7c2c2 Binary files /dev/null and b/mobile/apple/thumbs/plugin.png differ diff --git a/mobile/apple/thumbs/safari.png b/mobile/apple/thumbs/safari.png new file mode 100644 index 0000000..e7ca494 Binary files /dev/null and b/mobile/apple/thumbs/safari.png differ diff --git a/mobile/apple/thumbs/settings.png b/mobile/apple/thumbs/settings.png new file mode 100644 index 0000000..4b94e87 Binary files /dev/null and b/mobile/apple/thumbs/settings.png differ diff --git a/mobile/apple/thumbs/sketches.png b/mobile/apple/thumbs/sketches.png new file mode 100644 index 0000000..8d7bd14 Binary files /dev/null and b/mobile/apple/thumbs/sketches.png differ diff --git a/mobile/apple/thumbs/sms.png b/mobile/apple/thumbs/sms.png new file mode 100644 index 0000000..3c8af6c Binary files /dev/null and b/mobile/apple/thumbs/sms.png differ diff --git a/mobile/apple/thumbs/start.png b/mobile/apple/thumbs/start.png new file mode 100644 index 0000000..b22e245 Binary files /dev/null and b/mobile/apple/thumbs/start.png differ diff --git a/mobile/apple/thumbs/stocks.png b/mobile/apple/thumbs/stocks.png new file mode 100644 index 0000000..041648b Binary files /dev/null and b/mobile/apple/thumbs/stocks.png differ diff --git a/mobile/apple/thumbs/telephone.png b/mobile/apple/thumbs/telephone.png new file mode 100644 index 0000000..4b8e07a Binary files /dev/null and b/mobile/apple/thumbs/telephone.png differ diff --git a/mobile/apple/thumbs/video.png b/mobile/apple/thumbs/video.png new file mode 100644 index 0000000..0aa9248 Binary files /dev/null and b/mobile/apple/thumbs/video.png differ diff --git a/mobile/apple/thumbs/voice.png b/mobile/apple/thumbs/voice.png new file mode 100644 index 0000000..fd3a449 Binary files /dev/null and b/mobile/apple/thumbs/voice.png differ diff --git a/mobile/apple/thumbs/weather.png b/mobile/apple/thumbs/weather.png new file mode 100644 index 0000000..d22550b Binary files /dev/null and b/mobile/apple/thumbs/weather.png differ diff --git a/mobile/apple/thumbs/wordpress.png b/mobile/apple/thumbs/wordpress.png new file mode 100644 index 0000000..28f0f7e Binary files /dev/null and b/mobile/apple/thumbs/wordpress.png differ diff --git a/mobile/apple/thumbs/youtube.png b/mobile/apple/thumbs/youtube.png new file mode 100644 index 0000000..347880c Binary files /dev/null and b/mobile/apple/thumbs/youtube.png differ diff --git a/save.php b/save.php index 33fbbb3..3cb70bc 100644 --- a/save.php +++ b/save.php @@ -407,8 +407,8 @@ /******** End processing review table **********************************************************/ - $_SESSION['AP_SUCCESS']['title'] = 'Success'; - $_SESSION['AP_SUCCESS']['desc'] = 'Your form has been saved.'; + $_SESSION['AP_SUCCESS']['title'] = 'Completado'; + $_SESSION['AP_SUCCESS']['desc'] = 'Se ha guardado el formulario.'; echo '{ "status" : "ok", "message" : "'.$form_id.'" }';