Incam_FormulariosCalidad/includes/view-functions.php

96 lines
3.3 KiB
PHP
Raw Normal View History

<?php
/******************************************************************************
MachForm
Copyright 2007 Appnitro Software. This code cannot be redistributed without
permission from http://www.appnitro.com/
More info at: http://www.appnitro.com/
******************************************************************************/
require('mobileesp/mdetect.php');
require_once('includes/standard-view-functions.php');
require_once('includes/mobile-view-functions.php');
//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){
$agent_info = new uagent_info();
if ($agent_info->DetectIphoneOrIpod()) {
return mobile_display_form($form_id, $populated_values, $error_elements, $custom_error, $edit_id, $embed);
}
else {
return standard_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_display_integrated_form($form_id, $populated_values, $error_elements, $custom_error, $edit_id, $machform_path);
}
else {
return standard_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_display_success($form_id, $embed);
}
else {
return standard_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_display_integrated_success($form_id, $machform_path);
}
else {
return standard_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_display_form_review($form_id, $record_id, $embed);
}
else {
return standard_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_display_integrated_form_review($form_id, $record_id, $machform_path);
}
else {
return standard_display_integrated_form_review($form_id, $record_id, $machform_path);
}
}
?>