Poner checkboxes y radiobuttons en horizontal.
git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_FormulariosCalidad/trunk@14 e2c41b2c-0c6f-0149-8b81-50b1a9191bb3
This commit is contained in:
parent
635411b52b
commit
e7bfe401f2
@ -254,8 +254,8 @@ Tipo de campo
|
|||||||
<select class="select full" id="element_type" autocomplete="off" tabindex="12" onchange="set_properties(JJ(this).val(), 'type')">
|
<select class="select full" id="element_type" autocomplete="off" tabindex="12" onchange="set_properties(JJ(this).val(), 'type')">
|
||||||
<option value="text">Línea de texto</option>
|
<option value="text">Línea de texto</option>
|
||||||
<option value="textarea">Párrafo de texto</option>
|
<option value="textarea">Párrafo de texto</option>
|
||||||
<option value="radio">Selección múltiple</option>
|
<option value="radio">Botón de opciones</option>
|
||||||
<option value="checkbox">Cajas de selección</option>
|
<option value="checkbox">Casillas de selección</option>
|
||||||
<option value="select">Lista desplegable</option>
|
<option value="select">Lista desplegable</option>
|
||||||
<option value="number">Número</option>
|
<option value="number">Número</option>
|
||||||
<option value="simple_name">Nombre</option>
|
<option value="simple_name">Nombre</option>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 787 B After Width: | Height: | Size: 807 B |
Binary file not shown.
|
Before Width: | Height: | Size: 783 B After Width: | Height: | Size: 751 B |
@ -483,13 +483,8 @@ EOT;
|
|||||||
$guidelines = "<p class=\"guidelines\" id=\"guide_{$element->id}\"><small>{$element->guidelines}</small></p>";
|
$guidelines = "<p class=\"guidelines\" id=\"guide_{$element->id}\"><small>{$element->guidelines}</small></p>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$option_markup = '';
|
$option_markup .= '<table width="582px" border="0">';
|
||||||
|
$cell_col = 1;
|
||||||
if($element->constraint == 'random'){
|
|
||||||
$temp = $element->options;
|
|
||||||
shuffle($temp);
|
|
||||||
$element->options = $temp;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($element->options as $option){
|
foreach ($element->options as $option){
|
||||||
|
|
||||||
@ -502,15 +497,34 @@ EOT;
|
|||||||
//check for populated values
|
//check for populated values
|
||||||
if(!empty($element->populated_value['element_'.$element->id]['default_value'])){
|
if(!empty($element->populated_value['element_'.$element->id]['default_value'])){
|
||||||
$checked = '';
|
$checked = '';
|
||||||
if($element->populated_value['element_'.$element->id]['default_value'] == $option->id){
|
if($element->populated_value['element_'.$element->id]['default_value']
|
||||||
|
== $option->id){
|
||||||
$checked = 'checked="checked"';
|
$checked = 'checked="checked"';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$option_markup .= "<input id=\"element_{$element->id}_{$option->id}\" name=\"element_{$element->id}\" class=\"element radio\" type=\"radio\" value=\"{$option->id}\" {$checked} />\n";
|
$option_input = "<input id=\"element_{$element->id}_{$option->id}\"
|
||||||
$option_markup .= "<label class=\"choice\" for=\"element_{$element->id}_{$option->id}\">{$option->option}</label>\n";
|
name=\"element_{$element->id}\" class=\"element radio\"
|
||||||
|
type=\"radio\" value=\"{$option->id}\" {$checked} />";
|
||||||
|
$option_label = "<label class=\"choice\" for=\"element_{$element->id}_{$option->id}\">
|
||||||
|
{$option->option}</label>";
|
||||||
|
|
||||||
|
if ($cell_col == 1) {
|
||||||
|
$option_markup .= '<tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$option_markup .= '<td width="20%">' . $option_input . ' ' . $option_label . '</td>';
|
||||||
|
|
||||||
|
if ($cell_col == 5) {
|
||||||
|
$option_markup .= '</tr>';
|
||||||
|
$cell_col = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$cell_col++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$option_markup .= "</table>";
|
||||||
|
|
||||||
$element_markup = <<<EOT
|
$element_markup = <<<EOT
|
||||||
<li id="li_{$element->id}" {$error_class}>
|
<li id="li_{$element->id}" {$error_class}>
|
||||||
<label class="description">{$element->title} {$span_required}</label>
|
<label class="description">{$element->title} {$span_required}</label>
|
||||||
@ -558,6 +572,9 @@ EOT;
|
|||||||
|
|
||||||
$option_markup = '';
|
$option_markup = '';
|
||||||
|
|
||||||
|
$option_markup .= '<table width="580px" border="0" cellpadding="0">';
|
||||||
|
$cell_col = 1;
|
||||||
|
|
||||||
foreach ($element->options as $option){
|
foreach ($element->options as $option){
|
||||||
if(!$is_populated){
|
if(!$is_populated){
|
||||||
if($option->is_default){
|
if($option->is_default){
|
||||||
@ -567,19 +584,37 @@ EOT;
|
|||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
if(!empty($element->populated_value['element_'.$element->id.'_'.$option->id]['default_value'])){
|
if(!empty($element->populated_value['element_'.$element->id.'_'
|
||||||
|
.$option->id]['default_value'])){
|
||||||
$checked = 'checked="checked"';
|
$checked = 'checked="checked"';
|
||||||
}else{
|
}else{
|
||||||
$checked = '';
|
$checked = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$option_input = "<input id=\"element_{$element->id}_{$option->id}\"
|
||||||
|
name=\"element_{$element->id}_{$option->id}\"
|
||||||
|
class=\"element checkbox\" type=\"checkbox\" value=\"1\" {$checked} />";
|
||||||
|
$option_label = "<label class=\"choice\" for=\"element_{$element->id}_{$option->id}\">
|
||||||
|
{$option->option}</label>";
|
||||||
|
|
||||||
|
if ($cell_col == 1) {
|
||||||
|
$option_markup .= '<tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$option_markup .= '<td width="35%">' . $option_input . ' ' . $option_label . '</td>';
|
||||||
|
|
||||||
|
if ($cell_col == 3) {
|
||||||
|
$option_markup .= '</tr>';
|
||||||
|
$cell_col = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$cell_col++;
|
||||||
|
|
||||||
$option_markup .= "<input id=\"element_{$element->id}_{$option->id}\" name=\"element_{$element->id}_{$option->id}\" class=\"element checkbox\" type=\"checkbox\" value=\"1\" {$checked} />\n";
|
|
||||||
$option_markup .= "<label class=\"choice\" for=\"element_{$element->id}_{$option->id}\">{$option->option}</label>\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$option_markup .= '</table>';
|
||||||
|
|
||||||
$element_markup = <<<EOT
|
$element_markup = <<<EOT
|
||||||
<li id="li_{$element->id}" {$error_class}>
|
<li id="li_{$element->id}" {$error_class}>
|
||||||
<label class="description">{$element->title} {$span_required}</label>
|
<label class="description">{$element->title} {$span_required}</label>
|
||||||
|
|||||||
@ -3202,10 +3202,10 @@ data_source.prototype = {
|
|||||||
title = "Lista desplegable";
|
title = "Lista desplegable";
|
||||||
break;
|
break;
|
||||||
case "radio":
|
case "radio":
|
||||||
title = "Selección múltiple";
|
title = "Botón de opciones";
|
||||||
break;
|
break;
|
||||||
case "checkbox":
|
case "checkbox":
|
||||||
title = "Cajas de selección";
|
title = "Casillas de selección";
|
||||||
break;
|
break;
|
||||||
case "name":
|
case "name":
|
||||||
title = "Nombre";
|
title = "Nombre";
|
||||||
@ -3266,19 +3266,31 @@ data_source.prototype = {
|
|||||||
default_value: "",
|
default_value: "",
|
||||||
constraint: "",
|
constraint: "",
|
||||||
options: [{
|
options: [{
|
||||||
option: "Primera opción",
|
option: "Primera",
|
||||||
is_default: 0,
|
is_default: 0,
|
||||||
is_db_live: "0",
|
is_db_live: "0",
|
||||||
id: "0"
|
id: "0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
option: "Segunda opción",
|
option: "Segunda",
|
||||||
is_default: 0,
|
is_default: 0,
|
||||||
is_db_live: "0",
|
is_db_live: "0",
|
||||||
id: "0"
|
id: "0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
option: "Tercera opción",
|
option: "Tercera",
|
||||||
|
is_default: 0,
|
||||||
|
is_db_live: "0",
|
||||||
|
id: "0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
option: "Cuarta",
|
||||||
|
is_default: 0,
|
||||||
|
is_db_live: "0",
|
||||||
|
id: "0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
option: "Quinta",
|
||||||
is_default: 0,
|
is_default: 0,
|
||||||
is_db_live: "0",
|
is_db_live: "0",
|
||||||
id: "0"
|
id: "0"
|
||||||
|
|||||||
360
manage_form.php
360
manage_form.php
@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
MachForm
|
MachForm
|
||||||
|
|
||||||
Copyright 2007 Appnitro Software. This code cannot be redistributed without
|
Copyright 2007 Appnitro Software. This code cannot be redistributed without
|
||||||
permission from http://www.appnitro.com/
|
permission from http://www.appnitro.com/
|
||||||
|
|
||||||
More info at: http://www.appnitro.com/
|
More info at: http://www.appnitro.com/
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
require('config.php');
|
require('config.php');
|
||||||
require('includes/check-session.php');
|
require('includes/check-session.php');
|
||||||
require('includes/db-core.php');
|
require('includes/db-core.php');
|
||||||
@ -16,21 +16,21 @@
|
|||||||
require('includes/helper-functions.php');
|
require('includes/helper-functions.php');
|
||||||
|
|
||||||
connect_db();
|
connect_db();
|
||||||
|
|
||||||
$rows_per_page = 10;
|
$rows_per_page = 10;
|
||||||
|
|
||||||
//check for id parameter, if exist, populate the pageno automatically
|
//check for id parameter, if exist, populate the pageno automatically
|
||||||
if(!empty($_GET['id'])){
|
if(!empty($_GET['id'])){
|
||||||
$form_id = (int) trim($_GET['id']);
|
$form_id = (int) trim($_GET['id']);
|
||||||
|
|
||||||
$query = "select form_id from `ap_forms` order by form_id asc";
|
$query = "select form_id from `ap_forms` order by form_id asc";
|
||||||
$result = do_query($query);
|
$result = do_query($query);
|
||||||
|
|
||||||
while($row = do_fetch_result($result)){
|
while($row = do_fetch_result($result)){
|
||||||
$form_id_lookup[] = (int) $row['form_id'];
|
$form_id_lookup[] = (int) $row['form_id'];
|
||||||
}
|
}
|
||||||
$form_id_chunks = array_chunk($form_id_lookup,$rows_per_page);
|
$form_id_chunks = array_chunk($form_id_lookup,$rows_per_page);
|
||||||
|
|
||||||
foreach ($form_id_chunks as $key=>$value){
|
foreach ($form_id_chunks as $key=>$value){
|
||||||
$index_key = array_search($form_id,$value,true);
|
$index_key = array_search($form_id,$value,true);
|
||||||
if($index_key !== false){
|
if($index_key !== false){
|
||||||
@ -39,29 +39,29 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//check for form delete parameter
|
//check for form delete parameter
|
||||||
if(!empty($_GET['delete'])){
|
if(!empty($_GET['delete'])){
|
||||||
$deleted_form_id = (int) trim($_GET['delete']);
|
$deleted_form_id = (int) trim($_GET['delete']);
|
||||||
delete_form($deleted_form_id);
|
delete_form($deleted_form_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
//check for form duplicate parameter
|
//check for form duplicate parameter
|
||||||
if(!empty($_GET['duplicate'])){
|
if(!empty($_GET['duplicate'])){
|
||||||
$target_form_id = (int) trim($_GET['duplicate']);
|
$target_form_id = (int) trim($_GET['duplicate']);
|
||||||
$result_form_id = duplicate_form($target_form_id);
|
$result_form_id = duplicate_form($target_form_id);
|
||||||
|
|
||||||
if(!empty($result_form_id)){
|
if(!empty($result_form_id)){
|
||||||
$_SESSION['AP_SUCCESS']['title'] = 'Completado';
|
$_SESSION['AP_SUCCESS']['title'] = 'Completado';
|
||||||
$_SESSION['AP_SUCCESS']['desc'] = 'Formulario duplicado.';
|
$_SESSION['AP_SUCCESS']['desc'] = 'Formulario duplicado.';
|
||||||
|
|
||||||
header("Location: manage_form.php?id={$result_form_id}");
|
header("Location: manage_form.php?id={$result_form_id}");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/****Pagination *************/
|
/****Pagination *************/
|
||||||
//get page number for pagination
|
//get page number for pagination
|
||||||
if(!empty($pageno_auto)){
|
if(!empty($pageno_auto)){
|
||||||
@ -71,36 +71,36 @@
|
|||||||
}else{
|
}else{
|
||||||
$pageno = 1;
|
$pageno = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//identify how many database rows are available
|
//identify how many database rows are available
|
||||||
$query = "select count(*) total_row from `ap_forms`";
|
$query = "select count(*) total_row from `ap_forms`";
|
||||||
$result = do_query($query);
|
$result = do_query($query);
|
||||||
$row = do_fetch_result($result);
|
$row = do_fetch_result($result);
|
||||||
|
|
||||||
$numrows = $row['total_row'];
|
$numrows = $row['total_row'];
|
||||||
|
|
||||||
$lastpage = ceil($numrows/$rows_per_page);
|
$lastpage = ceil($numrows/$rows_per_page);
|
||||||
|
|
||||||
|
|
||||||
//ensure that $pageno is within range
|
//ensure that $pageno is within range
|
||||||
//this code checks that the value of $pageno is an integer between 1 and $lastpage
|
//this code checks that the value of $pageno is an integer between 1 and $lastpage
|
||||||
$pageno = (int)$pageno;
|
$pageno = (int)$pageno;
|
||||||
|
|
||||||
if ($pageno < 1) {
|
if ($pageno < 1) {
|
||||||
$pageno = 1;
|
$pageno = 1;
|
||||||
}
|
}
|
||||||
elseif ($pageno > $lastpage){
|
elseif ($pageno > $lastpage){
|
||||||
$pageno = $lastpage;
|
$pageno = $lastpage;
|
||||||
}
|
}
|
||||||
|
|
||||||
//construct the LIMIT clause for the sql SELECT statement
|
//construct the LIMIT clause for the sql SELECT statement
|
||||||
if(!empty($numrows)){
|
if(!empty($numrows)){
|
||||||
$limit = 'LIMIT ' .($pageno - 1) * $rows_per_page .',' .$rows_per_page;
|
$limit = 'LIMIT ' .($pageno - 1) * $rows_per_page .',' .$rows_per_page;
|
||||||
}
|
}
|
||||||
/*****End Pagination code *******/
|
/*****End Pagination code *******/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//get form list
|
//get form list
|
||||||
$query = "select form_id,form_name,form_active,form_email from `ap_forms` order by form_id asc $limit";
|
$query = "select form_id,form_name,form_active,form_email from `ap_forms` order by form_id asc $limit";
|
||||||
$result = do_query($query);
|
$result = do_query($query);
|
||||||
@ -109,16 +109,16 @@
|
|||||||
while($row = do_fetch_result($result)){
|
while($row = do_fetch_result($result)){
|
||||||
$form_list[$i]['form_id'] = $row['form_id'];
|
$form_list[$i]['form_id'] = $row['form_id'];
|
||||||
$form_list[$i]['form_name'] = $row['form_name'];
|
$form_list[$i]['form_name'] = $row['form_name'];
|
||||||
$form_list[$i]['form_active'] = $row['form_active'];
|
$form_list[$i]['form_active'] = $row['form_active'];
|
||||||
if(!empty($row['form_email'])){
|
if(!empty($row['form_email'])){
|
||||||
$form_list[$i]['form_email'] = $row['form_email'];
|
$form_list[$i]['form_email'] = $row['form_email'];
|
||||||
}else{
|
}else{
|
||||||
$form_list[$i]['form_email'] = 'nadie';
|
$form_list[$i]['form_email'] = 'nadie';
|
||||||
}
|
}
|
||||||
$form_id_array[] = $row['form_id'];
|
$form_id_array[] = $row['form_id'];
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//get total entries for each form
|
//get total entries for each form
|
||||||
foreach ($form_id_array as $form_id){
|
foreach ($form_id_array as $form_id){
|
||||||
//get all time entries
|
//get all time entries
|
||||||
@ -126,20 +126,20 @@
|
|||||||
$result = do_query($query);
|
$result = do_query($query);
|
||||||
$row = do_fetch_result($result);
|
$row = do_fetch_result($result);
|
||||||
$entries[$form_id]['total'] = $row['total_entry'];
|
$entries[$form_id]['total'] = $row['total_entry'];
|
||||||
|
|
||||||
//get todays entries
|
//get todays entries
|
||||||
$query = "select count(*) today_entry from `ap_form_{$form_id}` where date_created >= date_format(curdate(),'%Y-%m-%d 00:00:00') ";
|
$query = "select count(*) today_entry from `ap_form_{$form_id}` where date_created >= date_format(curdate(),'%Y-%m-%d 00:00:00') ";
|
||||||
$result = do_query($query);
|
$result = do_query($query);
|
||||||
$row = do_fetch_result($result);
|
$row = do_fetch_result($result);
|
||||||
$entries[$form_id]['today'] = $row['today_entry'];
|
$entries[$form_id]['today'] = $row['today_entry'];
|
||||||
|
|
||||||
//get latest entry timing
|
//get latest entry timing
|
||||||
$query = "select date_created from `ap_form_{$form_id}` order by id desc limit 1";
|
$query = "select date_created from `ap_form_{$form_id}` order by id desc limit 1";
|
||||||
$result = do_query($query);
|
$result = do_query($query);
|
||||||
$row = do_fetch_result($result);
|
$row = do_fetch_result($result);
|
||||||
$entries[$form_id]['latest_entry'] = relative_date($row['date_created']);
|
$entries[$form_id]['latest_entry'] = relative_date($row['date_created']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$header_data =<<<EOT
|
$header_data =<<<EOT
|
||||||
<script type="text/javascript" src="js/base.js"></script>
|
<script type="text/javascript" src="js/base.js"></script>
|
||||||
<script type="text/javascript" src="js/rico.js"></script>
|
<script type="text/javascript" src="js/rico.js"></script>
|
||||||
@ -158,98 +158,98 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script language="javascript" type="text/javascript">
|
<script language="javascript" type="text/javascript">
|
||||||
|
|
||||||
function disable_form(form_id){
|
function disable_form(form_id){
|
||||||
var progress_image = $('progress_image_' + form_id);
|
var progress_image = $('progress_image_' + form_id);
|
||||||
progress_image.style.visibility = "visible";
|
progress_image.style.visibility = "visible";
|
||||||
|
|
||||||
$('activation_link_' + form_id).innerHTML = 'Procesando...';
|
$('activation_link_' + form_id).innerHTML = 'Procesando...';
|
||||||
$('activation_link_' + form_id).href = '#';
|
$('activation_link_' + form_id).href = '#';
|
||||||
|
|
||||||
var url = 'ajax_form_activation.php';
|
var url = 'ajax_form_activation.php';
|
||||||
var pars = 'form_id=' + form_id + '&operation=disable';
|
var pars = 'form_id=' + form_id + '&operation=disable';
|
||||||
|
|
||||||
var myAjax = new Ajax.Request( url, { method: 'post', parameters: pars, onComplete: showResponseDisabled });
|
var myAjax = new Ajax.Request( url, { method: 'post', parameters: pars, onComplete: showResponseDisabled });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function showResponseDisabled(originalRequest){
|
function showResponseDisabled(originalRequest){
|
||||||
var response = originalRequest.responseText;
|
var response = originalRequest.responseText;
|
||||||
|
|
||||||
$('form_status_' + response).innerHTML = 'Desactivado';
|
$('form_status_' + response).innerHTML = 'Desactivado';
|
||||||
$('image_status_' + response).src = 'images/icons/disabled.gif';
|
$('image_status_' + response).src = 'images/icons/disabled.gif';
|
||||||
$('activation_link_' + response).innerHTML = 'Activar este formulario';
|
$('activation_link_' + response).innerHTML = 'Activar este formulario';
|
||||||
$('activation_link_' + response).href = 'javascript: enable_form(' + response + ')';
|
$('activation_link_' + response).href = 'javascript: enable_form(' + response + ')';
|
||||||
|
|
||||||
var progress_image = $('progress_image_' + response);
|
var progress_image = $('progress_image_' + response);
|
||||||
progress_image.style.visibility = "hidden";
|
progress_image.style.visibility = "hidden";
|
||||||
|
|
||||||
new Effect.Highlight('form_status_' + response,{duration:1});
|
new Effect.Highlight('form_status_' + response,{duration:1});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function enable_form(form_id){
|
function enable_form(form_id){
|
||||||
var progress_image = $('progress_image_' + form_id);
|
var progress_image = $('progress_image_' + form_id);
|
||||||
progress_image.style.visibility = "visible";
|
progress_image.style.visibility = "visible";
|
||||||
|
|
||||||
$('activation_link_' + form_id).innerHTML = 'Procesando...';
|
$('activation_link_' + form_id).innerHTML = 'Procesando...';
|
||||||
$('activation_link_' + form_id).href = '#';
|
$('activation_link_' + form_id).href = '#';
|
||||||
|
|
||||||
var url = 'ajax_form_activation.php';
|
var url = 'ajax_form_activation.php';
|
||||||
var pars = 'form_id=' + form_id + '&operation=enable';
|
var pars = 'form_id=' + form_id + '&operation=enable';
|
||||||
|
|
||||||
var myAjax = new Ajax.Request( url, { method: 'post', parameters: pars, onComplete: showResponseEnabled });
|
var myAjax = new Ajax.Request( url, { method: 'post', parameters: pars, onComplete: showResponseEnabled });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function showResponseEnabled(originalRequest){
|
function showResponseEnabled(originalRequest){
|
||||||
var response = originalRequest.responseText;
|
var response = originalRequest.responseText;
|
||||||
|
|
||||||
$('form_status_' + response).innerHTML = 'Activado';
|
$('form_status_' + response).innerHTML = 'Activado';
|
||||||
$('image_status_' + response).src = 'images/icons/checkbox.gif';
|
$('image_status_' + response).src = 'images/icons/checkbox.gif';
|
||||||
$('activation_link_' + response).innerHTML = 'Desactivar este formulario';
|
$('activation_link_' + response).innerHTML = 'Desactivar este formulario';
|
||||||
$('activation_link_' + response).href = 'javascript: disable_form(' + response + ')';
|
$('activation_link_' + response).href = 'javascript: disable_form(' + response + ')';
|
||||||
|
|
||||||
var progress_image = $('progress_image_' + response);
|
var progress_image = $('progress_image_' + response);
|
||||||
progress_image.style.visibility = "hidden";
|
progress_image.style.visibility = "hidden";
|
||||||
|
|
||||||
new Effect.Highlight('form_status_' + response,{duration:1});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
new Effect.Highlight('form_status_' + response,{duration:1});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
EOT;
|
EOT;
|
||||||
|
|
||||||
//delete a form, definition, entries and uploaded files
|
//delete a form, definition, entries and uploaded files
|
||||||
function delete_form($form_id){
|
function delete_form($form_id){
|
||||||
//remove from ap_forms
|
//remove from ap_forms
|
||||||
$query = "delete from `ap_forms` where form_id='$form_id'";
|
$query = "delete from `ap_forms` where form_id='$form_id'";
|
||||||
do_query($query);
|
do_query($query);
|
||||||
|
|
||||||
//remove from ap_form_elements
|
//remove from ap_form_elements
|
||||||
$query = "delete from `ap_form_elements` where form_id='$form_id'";
|
$query = "delete from `ap_form_elements` where form_id='$form_id'";
|
||||||
do_query($query);
|
do_query($query);
|
||||||
|
|
||||||
//remove from ap_element_options
|
//remove from ap_element_options
|
||||||
$query = "delete from `ap_element_options` where form_id='$form_id'";
|
$query = "delete from `ap_element_options` where form_id='$form_id'";
|
||||||
do_query($query);
|
do_query($query);
|
||||||
|
|
||||||
//remove from ap_column_preferences
|
//remove from ap_column_preferences
|
||||||
$query = "delete from `ap_column_preferences` where form_id='$form_id'";
|
$query = "delete from `ap_column_preferences` where form_id='$form_id'";
|
||||||
do_query($query);
|
do_query($query);
|
||||||
|
|
||||||
//remove review table
|
//remove review table
|
||||||
$query = "drop table if exists `ap_form_{$form_id}_review`";
|
$query = "drop table if exists `ap_form_{$form_id}_review`";
|
||||||
do_query($query);
|
do_query($query);
|
||||||
|
|
||||||
//remove the actual table
|
//remove the actual table
|
||||||
$query = "drop table if exists `ap_form_{$form_id}`";
|
$query = "drop table if exists `ap_form_{$form_id}`";
|
||||||
do_query($query);
|
do_query($query);
|
||||||
|
|
||||||
//remove form folder
|
//remove form folder
|
||||||
@full_rmdir(UPLOAD_DIR."/form_{$form_id}");
|
@full_rmdir(UPLOAD_DIR."/form_{$form_id}");
|
||||||
if(DATA_DIR != UPLOAD_DIR){
|
if(DATA_DIR != UPLOAD_DIR){
|
||||||
@full_rmdir(DATA_DIR."/form_{$form_id}");
|
@full_rmdir(DATA_DIR."/form_{$form_id}");
|
||||||
@ -259,7 +259,7 @@ EOT;
|
|||||||
|
|
||||||
//duplicate a form
|
//duplicate a form
|
||||||
function duplicate_form($form_id){
|
function duplicate_form($form_id){
|
||||||
|
|
||||||
//set the new name
|
//set the new name
|
||||||
$query = "select form_name,form_review from `ap_forms` where form_id='$form_id'";
|
$query = "select form_name,form_review from `ap_forms` where form_id='$form_id'";
|
||||||
$result = do_query($query);
|
$result = do_query($query);
|
||||||
@ -267,137 +267,137 @@ EOT;
|
|||||||
$form_review = $row['form_review'];
|
$form_review = $row['form_review'];
|
||||||
$form_name = trim($row['form_name']);
|
$form_name = trim($row['form_name']);
|
||||||
$form_name .= " Copy";
|
$form_name .= " Copy";
|
||||||
|
|
||||||
//get new form_id
|
//get new form_id
|
||||||
$query = "select max(form_id)+1 new_form_id from `ap_forms`";
|
$query = "select max(form_id)+1 new_form_id from `ap_forms`";
|
||||||
$result = do_query($query);
|
$result = do_query($query);
|
||||||
$row = do_fetch_result($result);
|
$row = do_fetch_result($result);
|
||||||
$new_form_id = trim($row['new_form_id']);
|
$new_form_id = trim($row['new_form_id']);
|
||||||
|
|
||||||
//insert into ap_forms table
|
//insert into ap_forms table
|
||||||
$query = "select * from `ap_forms` where form_id='{$form_id}'";
|
$query = "select * from `ap_forms` where form_id='{$form_id}'";
|
||||||
$result = do_query($query);
|
$result = do_query($query);
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$columns = array();
|
$columns = array();
|
||||||
$fields_num = mysql_num_fields($result);
|
$fields_num = mysql_num_fields($result);
|
||||||
while($i < $fields_num){
|
while($i < $fields_num){
|
||||||
$meta = mysql_fetch_field($result, $i);
|
$meta = mysql_fetch_field($result, $i);
|
||||||
|
|
||||||
if(($meta->name != 'form_id') && ($meta->name != 'form_name')){
|
if(($meta->name != 'form_id') && ($meta->name != 'form_name')){
|
||||||
$columns[] = $meta->name;
|
$columns[] = $meta->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//build the query string
|
//build the query string
|
||||||
$columns_joined = implode(",",$columns);
|
$columns_joined = implode(",",$columns);
|
||||||
$form_name = mysql_real_escape_string($form_name);
|
$form_name = mysql_real_escape_string($form_name);
|
||||||
|
|
||||||
//insert to ap_forms
|
//insert to ap_forms
|
||||||
$query = "insert into
|
$query = "insert into
|
||||||
`ap_forms`(form_id,form_name,{$columns_joined})
|
`ap_forms`(form_id,form_name,{$columns_joined})
|
||||||
select
|
select
|
||||||
{$new_form_id},'{$form_name}',{$columns_joined}
|
{$new_form_id},'{$form_name}',{$columns_joined}
|
||||||
from
|
from
|
||||||
`ap_forms`
|
`ap_forms`
|
||||||
where
|
where
|
||||||
form_id='$form_id'";
|
form_id='$form_id'";
|
||||||
do_query($query);
|
do_query($query);
|
||||||
|
|
||||||
//create the new table
|
//create the new table
|
||||||
do_query("create table `ap_form_{$new_form_id}` like `ap_form_{$form_id}`");
|
do_query("create table `ap_form_{$new_form_id}` like `ap_form_{$form_id}`");
|
||||||
|
|
||||||
|
|
||||||
//copy ap_form_elements table
|
//copy ap_form_elements table
|
||||||
$query = "select * from `ap_form_elements` limit 1";
|
$query = "select * from `ap_form_elements` limit 1";
|
||||||
$result = do_query($query);
|
$result = do_query($query);
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$columns = array();
|
$columns = array();
|
||||||
$fields_num = mysql_num_fields($result);
|
$fields_num = mysql_num_fields($result);
|
||||||
while($i < $fields_num){
|
while($i < $fields_num){
|
||||||
$meta = mysql_fetch_field($result, $i);
|
$meta = mysql_fetch_field($result, $i);
|
||||||
|
|
||||||
if($meta->name != 'form_id'){
|
if($meta->name != 'form_id'){
|
||||||
$columns[] = $meta->name;
|
$columns[] = $meta->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$columns_joined = implode("`,`",$columns);
|
$columns_joined = implode("`,`",$columns);
|
||||||
$query = "insert into
|
$query = "insert into
|
||||||
`ap_form_elements`(form_id,`{$columns_joined}`)
|
`ap_form_elements`(form_id,`{$columns_joined}`)
|
||||||
select
|
select
|
||||||
{$new_form_id},`{$columns_joined}`
|
{$new_form_id},`{$columns_joined}`
|
||||||
from
|
from
|
||||||
`ap_form_elements`
|
`ap_form_elements`
|
||||||
where
|
where
|
||||||
form_id='$form_id'";
|
form_id='$form_id'";
|
||||||
do_query($query);
|
do_query($query);
|
||||||
|
|
||||||
//copy ap_element_options table
|
//copy ap_element_options table
|
||||||
$query = "select * from `ap_element_options` limit 1";
|
$query = "select * from `ap_element_options` limit 1";
|
||||||
$result = do_query($query);
|
$result = do_query($query);
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$columns = array();
|
$columns = array();
|
||||||
$fields_num = mysql_num_fields($result);
|
$fields_num = mysql_num_fields($result);
|
||||||
while($i < $fields_num){
|
while($i < $fields_num){
|
||||||
$meta = mysql_fetch_field($result, $i);
|
$meta = mysql_fetch_field($result, $i);
|
||||||
|
|
||||||
if(($meta->name != 'form_id') && ($meta->name != 'aeo_id')){
|
if(($meta->name != 'form_id') && ($meta->name != 'aeo_id')){
|
||||||
$columns[] = $meta->name;
|
$columns[] = $meta->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$columns_joined = implode("`,`",$columns);
|
$columns_joined = implode("`,`",$columns);
|
||||||
$query = "insert into
|
$query = "insert into
|
||||||
`ap_element_options`(form_id,`{$columns_joined}`)
|
`ap_element_options`(form_id,`{$columns_joined}`)
|
||||||
select
|
select
|
||||||
{$new_form_id},`{$columns_joined}`
|
{$new_form_id},`{$columns_joined}`
|
||||||
from
|
from
|
||||||
`ap_element_options`
|
`ap_element_options`
|
||||||
where
|
where
|
||||||
form_id='$form_id'";
|
form_id='$form_id'";
|
||||||
do_query($query);
|
do_query($query);
|
||||||
|
|
||||||
|
|
||||||
//copy ap_column_preferences table
|
//copy ap_column_preferences table
|
||||||
$query = "select * from `ap_column_preferences` limit 1";
|
$query = "select * from `ap_column_preferences` limit 1";
|
||||||
$result = do_query($query);
|
$result = do_query($query);
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$columns = array();
|
$columns = array();
|
||||||
$fields_num = mysql_num_fields($result);
|
$fields_num = mysql_num_fields($result);
|
||||||
while($i < $fields_num){
|
while($i < $fields_num){
|
||||||
$meta = mysql_fetch_field($result, $i);
|
$meta = mysql_fetch_field($result, $i);
|
||||||
|
|
||||||
if(($meta->name != 'form_id') && ($meta->name != 'acp_id')){
|
if(($meta->name != 'form_id') && ($meta->name != 'acp_id')){
|
||||||
$columns[] = $meta->name;
|
$columns[] = $meta->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$columns_joined = implode("`,`",$columns);
|
$columns_joined = implode("`,`",$columns);
|
||||||
$query = "insert into
|
$query = "insert into
|
||||||
`ap_column_preferences`(form_id,`{$columns_joined}`)
|
`ap_column_preferences`(form_id,`{$columns_joined}`)
|
||||||
select
|
select
|
||||||
{$new_form_id},`{$columns_joined}`
|
{$new_form_id},`{$columns_joined}`
|
||||||
from
|
from
|
||||||
`ap_column_preferences`
|
`ap_column_preferences`
|
||||||
where
|
where
|
||||||
form_id='$form_id'";
|
form_id='$form_id'";
|
||||||
do_query($query);
|
do_query($query);
|
||||||
|
|
||||||
//copy ap_form_xx_review table if exists
|
//copy ap_form_xx_review table if exists
|
||||||
if(!empty($form_review)){
|
if(!empty($form_review)){
|
||||||
do_query("CREATE TABLE `ap_form_{$new_form_id}_review` like `ap_form_{$form_id}_review`");
|
do_query("CREATE TABLE `ap_form_{$new_form_id}_review` like `ap_form_{$form_id}_review`");
|
||||||
}
|
}
|
||||||
|
|
||||||
//create form folder
|
//create form folder
|
||||||
$old_mask = umask(0);
|
$old_mask = umask(0);
|
||||||
mkdir(DATA_DIR."/form_{$new_form_id}",0777);
|
mkdir(DATA_DIR."/form_{$new_form_id}",0777);
|
||||||
@ -407,13 +407,13 @@ EOT;
|
|||||||
}
|
}
|
||||||
mkdir(UPLOAD_DIR."/form_{$new_form_id}/files",0777);
|
mkdir(UPLOAD_DIR."/form_{$new_form_id}/files",0777);
|
||||||
umask($old_mask);
|
umask($old_mask);
|
||||||
|
|
||||||
//copy css file
|
//copy css file
|
||||||
copy(DATA_DIR."/form_{$form_id}/css/view.css",DATA_DIR."/form_{$new_form_id}/css/view.css");
|
copy(DATA_DIR."/form_{$form_id}/css/view.css",DATA_DIR."/form_{$new_form_id}/css/view.css");
|
||||||
|
|
||||||
return $new_form_id;
|
return $new_form_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php require('includes/header.php'); ?>
|
<?php require('includes/header.php'); ?>
|
||||||
@ -431,29 +431,29 @@ EOT;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$i=($pageno -1) * $rows_per_page + 1;
|
$i=($pageno -1) * $rows_per_page + 1;
|
||||||
$first_row_number = $i;
|
$first_row_number = $i;
|
||||||
if(!empty($form_list)){
|
if(!empty($form_list)){
|
||||||
|
|
||||||
echo '<div id="accordionDiv">';
|
echo '<div id="accordionDiv">';
|
||||||
|
|
||||||
foreach ($form_list as $data){
|
foreach ($form_list as $data){
|
||||||
|
|
||||||
if(!empty($data['form_active'])){
|
if(!empty($data['form_active'])){
|
||||||
$form_status = 'Activado';
|
$form_status = 'Activado';
|
||||||
$image_status = 'checkbox.gif';
|
$image_status = 'checkbox.gif';
|
||||||
$activation_text = 'Desactivar este formulario';
|
$activation_text = 'Desactivar este formulario';
|
||||||
$activation_link = 'disable_form';
|
$activation_link = 'disable_form';
|
||||||
}else{
|
}else{
|
||||||
$form_status = 'Desactivado';
|
$form_status = 'Desactivado';
|
||||||
$image_status = 'disabled.gif';
|
$image_status = 'disabled.gif';
|
||||||
$activation_text = 'Activar este formulario';
|
$activation_text = 'Activar este formulario';
|
||||||
$activation_link = 'enable_form';
|
$activation_link = 'enable_form';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<div id="overviewPanel">
|
<div id="overviewPanel">
|
||||||
<div id="overviewHeader" class="accordionTabTitle">
|
<div id="overviewHeader" class="accordionTabTitle">
|
||||||
<h3><?php echo "$i. {$data['form_name']}" ?></h3>
|
<h3><?php echo "$i. {$data['form_name']}" ?></h3>
|
||||||
@ -465,7 +465,7 @@ EOT;
|
|||||||
<td width="9%"><a href="<?php echo "edit_form.php?id={$data['form_id']}"; ?>"><img src="images/icons/edit_form_32.gif" /></a></td>
|
<td width="9%"><a href="<?php echo "edit_form.php?id={$data['form_id']}"; ?>"><img src="images/icons/edit_form_32.gif" /></a></td>
|
||||||
<td width="9%"><a href="<?php echo "edit_css.php?id={$data['form_id']}"; ?>"><img src="images/icons/colorize_32.gif" /></a></td>
|
<td width="9%"><a href="<?php echo "edit_css.php?id={$data['form_id']}"; ?>"><img src="images/icons/colorize_32.gif" /></a></td>
|
||||||
<td width="9%"><a href="<?php echo "email_settings.php?id={$data['form_id']}"; ?>"><img src="images/icons/mail_forward_32.gif" /></a></td>
|
<td width="9%"><a href="<?php echo "email_settings.php?id={$data['form_id']}"; ?>"><img src="images/icons/mail_forward_32.gif" /></a></td>
|
||||||
<?php /*<td width="9%"><a href=" < ? p h p echo "embed_code.php?id={$data['form_id']}"; ? > "><img src="images/icons/embed_code_32.gif" /></a></td>*/ ?>
|
<td width="9%"><a href="<?php echo "embed_code.php?id={$data['form_id']}"; ?>"><img src="images/icons/embed_code_32.gif" /></a></td>
|
||||||
<td width="9%"> </td>
|
<td width="9%"> </td>
|
||||||
<td width="9%"><a href="view.php?id=<?php echo $data['form_id']; ?>" target="_blank"><img src="images/icons/view_form_32.gif" /></a></td>
|
<td width="9%"><a href="view.php?id=<?php echo $data['form_id']; ?>" target="_blank"><img src="images/icons/view_form_32.gif" /></a></td>
|
||||||
<td width="21%"> </td>
|
<td width="21%"> </td>
|
||||||
@ -477,54 +477,54 @@ EOT;
|
|||||||
<td><a href="<?php echo "edit_form.php?id={$data['form_id']}"; ?>">Editar form.</a></td>
|
<td><a href="<?php echo "edit_form.php?id={$data['form_id']}"; ?>">Editar form.</a></td>
|
||||||
<td nowrap><a href="<?php echo "edit_css.php?id={$data['form_id']}"; ?>">Editar estilo</a></td>
|
<td nowrap><a href="<?php echo "edit_css.php?id={$data['form_id']}"; ?>">Editar estilo</a></td>
|
||||||
<td nowrap><a href="<?php echo "email_settings.php?id={$data['form_id']}"; ?>">Emails</a></td>
|
<td nowrap><a href="<?php echo "email_settings.php?id={$data['form_id']}"; ?>">Emails</a></td>
|
||||||
<?php /*<td nowrap><a href=" < ? p h p echo "embed_code.php?id={$data['form_id']}"; ? > ">Código</a></td> */ ?>
|
<td nowrap><a href="<?php echo "embed_code.php?id={$data['form_id']}"; ?>">Código</a></td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td><a href="view.php?id=<?php echo $data['form_id']; ?>" target="_blank">Ver formulario</a></td>
|
<td><a href="view.php?id=<?php echo $data['form_id']; ?>" target="_blank">Ver formulario</a></td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td><a href="<?php echo "manage_form.php?duplicate={$data['form_id']}"; ?>">Duplicar</a></td>
|
<td><a href="<?php echo "manage_form.php?duplicate={$data['form_id']}"; ?>">Duplicar</a></td>
|
||||||
<td><a href="manage_form.php?pageno=<?php echo $pageno; ?>&delete=<?php echo $data['form_id']; ?>" onclick="javascript: return confirm('Este formulario y sus respuestas se eliminarán. ¿Desea continuar?');">Borrar</a></td>
|
<td><a href="manage_form.php?pageno=<?php echo $pageno; ?>&delete=<?php echo $data['form_id']; ?>" onclick="javascript: return confirm('Este formulario y sus respuestas se eliminarán. ¿Desea continuar?');">Borrar</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<div style="clear:both; padding-left: 10px; padding-top: 10px">
|
<div style="clear:both; padding-left: 10px; padding-top: 10px">
|
||||||
Respuestas de hoy: <strong><?php echo $entries[$data['form_id']]['today']; ?></strong><br>
|
Respuestas de hoy: <strong><?php echo $entries[$data['form_id']]['today']; ?></strong><br>
|
||||||
Total de respuestas: <strong><?php echo $entries[$data['form_id']]['total']; ?></strong><br><br>
|
Total de respuestas: <strong><?php echo $entries[$data['form_id']]['total']; ?></strong><br><br>
|
||||||
Última respuesta: <strong><?php echo $entries[$data['form_id']]['latest_entry']; ?></strong><br>
|
Última respuesta: <strong><?php echo $entries[$data['form_id']]['latest_entry']; ?></strong><br>
|
||||||
|
|
||||||
<div id="edit_form_email_text_<?php echo $data['form_id']; ?>" style="margin-top: 15px;display:block">
|
<div id="edit_form_email_text_<?php echo $data['form_id']; ?>" style="margin-top: 15px;display:block">
|
||||||
Las notificaciones se enviarán a: <strong><span id="form_email_name_box_<?php echo $data['form_id']; ?>"><?php echo $data['form_email']; ?></span></strong>
|
Las notificaciones se enviarán a: <strong><span id="form_email_name_box_<?php echo $data['form_id']; ?>"><?php echo $data['form_email']; ?></span></strong>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
Estado del formulario:
|
Estado del formulario:
|
||||||
<strong><span id="form_status_<?php echo $data['form_id']; ?>"><?php echo $form_status; ?></span></strong> <img id="image_status_<?php echo $data['form_id']; ?>" align="absmiddle" src="images/icons/<?php echo $image_status; ?>" /> <a id="activation_link_<?php echo $data['form_id']; ?>" href="javascript: <?php echo $activation_link; ?>(<?php echo $data['form_id']; ?>)" style="text-decoration: none; border-bottom: 1px dotted #000"><?php echo $activation_text; ?></a>
|
<strong><span id="form_status_<?php echo $data['form_id']; ?>"><?php echo $form_status; ?></span></strong> <img id="image_status_<?php echo $data['form_id']; ?>" align="absmiddle" src="images/icons/<?php echo $image_status; ?>" /> <a id="activation_link_<?php echo $data['form_id']; ?>" href="javascript: <?php echo $activation_link; ?>(<?php echo $data['form_id']; ?>)" style="text-decoration: none; border-bottom: 1px dotted #000"><?php echo $activation_text; ?></a>
|
||||||
<img id="progress_image_<?php echo $data['form_id']; ?>" align="absmiddle" src="images/loader-red.gif" style="visibility: hidden"/>
|
<img id="progress_image_<?php echo $data['form_id']; ?>" align="absmiddle" src="images/loader-red.gif" style="visibility: hidden"/>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$last_row_number = --$i;
|
$last_row_number = --$i;
|
||||||
|
|
||||||
if(!empty($active_tab_auto)){
|
if(!empty($active_tab_auto)){
|
||||||
$active_tab = $active_tab_auto;
|
$active_tab = $active_tab_auto;
|
||||||
}else{
|
}else{
|
||||||
$active_tab = 0;
|
$active_tab = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
echo '<script type="text/javascript">';
|
echo '<script type="text/javascript">';
|
||||||
echo 'new Rico.Accordion( $(\'accordionDiv\'), {panelHeight:200,expandedBg: \'#4B75B3\',collapsedBg: \'#4B75B3\',hoverBg: \'#3661A1\', onLoadShowTab: '.$active_tab.'} );';
|
echo 'new Rico.Accordion( $(\'accordionDiv\'), {panelHeight:200,expandedBg: \'#4B75B3\',collapsedBg: \'#4B75B3\',hoverBg: \'#3661A1\', onLoadShowTab: '.$active_tab.'} );';
|
||||||
echo '</script>';
|
echo '</script>';
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
echo "<div style=\"height: 200px; text-align: center;padding-top: 70px\"><h2>No hay formularios.</h2></div>";
|
echo "<div style=\"height: 200px; text-align: center;padding-top: 70px\"><h2>No hay formularios.</h2></div>";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -532,22 +532,22 @@ EOT;
|
|||||||
<!-- start paging div -->
|
<!-- start paging div -->
|
||||||
<div id="paging" >
|
<div id="paging" >
|
||||||
<br>
|
<br>
|
||||||
<?php
|
<?php
|
||||||
if(!empty($lastpage))
|
if(!empty($lastpage))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if ($pageno != 1)
|
if ($pageno != 1)
|
||||||
{
|
{
|
||||||
|
|
||||||
if($lastpage > 19){
|
if($lastpage > 19){
|
||||||
echo " <a href='{$_SERVER['PHP_SELF']}?pageno=1'><<First</a> ";
|
echo " <a href='{$_SERVER['PHP_SELF']}?pageno=1'><<First</a> ";
|
||||||
}
|
}
|
||||||
$prevpage = $pageno-1;
|
$prevpage = $pageno-1;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//middle navigation
|
//middle navigation
|
||||||
if($pageno == 1){
|
if($pageno == 1){
|
||||||
$i=1;
|
$i=1;
|
||||||
@ -564,7 +564,7 @@ EOT;
|
|||||||
echo ' ... ';
|
echo ' ... ';
|
||||||
}
|
}
|
||||||
}elseif ($pageno == $lastpage){
|
}elseif ($pageno == $lastpage){
|
||||||
|
|
||||||
if(($lastpage - 19) > 1){
|
if(($lastpage - 19) > 1){
|
||||||
echo ' ... ';
|
echo ' ... ';
|
||||||
$i=1;
|
$i=1;
|
||||||
@ -591,18 +591,18 @@ EOT;
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
$next_pages = false;
|
$next_pages = false;
|
||||||
$prev_pages = false;
|
$prev_pages = false;
|
||||||
|
|
||||||
if(($lastpage - ($pageno + 9)) >= 1){
|
if(($lastpage - ($pageno + 9)) >= 1){
|
||||||
$next_pages = true;
|
$next_pages = true;
|
||||||
}
|
}
|
||||||
if(($pageno - 9) > 1){
|
if(($pageno - 9) > 1){
|
||||||
$prev_pages = true;
|
$prev_pages = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($prev_pages){ //if there are previous pages
|
if($prev_pages){ //if there are previous pages
|
||||||
echo ' ... ';
|
echo ' ... ';
|
||||||
if($next_pages){ //if there are next pages
|
if($next_pages){ //if there are next pages
|
||||||
@ -620,7 +620,7 @@ EOT;
|
|||||||
}
|
}
|
||||||
echo ' ... ';
|
echo ' ... ';
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
$i=1;
|
$i=1;
|
||||||
$j=$pageno - 9;
|
$j=$pageno - 9;
|
||||||
while(($i<=19) && ($j <= $lastpage)){
|
while(($i<=19) && ($j <= $lastpage)){
|
||||||
@ -633,9 +633,9 @@ EOT;
|
|||||||
$i++;
|
$i++;
|
||||||
$j++;
|
$j++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{ //if there aren't previous pages
|
}else{ //if there aren't previous pages
|
||||||
|
|
||||||
$i=1;
|
$i=1;
|
||||||
while(($i<=19) && ($i <= $lastpage)){
|
while(($i<=19) && ($i <= $lastpage)){
|
||||||
if($i != $pageno){
|
if($i != $pageno){
|
||||||
@ -645,26 +645,26 @@ EOT;
|
|||||||
}
|
}
|
||||||
echo " <a href='{$_SERVER['PHP_SELF']}?pageno=$i' $active_style>$i</a> ";
|
echo " <a href='{$_SERVER['PHP_SELF']}?pageno=$i' $active_style>$i</a> ";
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
}
|
}
|
||||||
if($next_pages){
|
if($next_pages){
|
||||||
echo ' ... ';
|
echo ' ... ';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($pageno != $lastpage)
|
if ($pageno != $lastpage)
|
||||||
{
|
{
|
||||||
$nextpage = $pageno+1;
|
$nextpage = $pageno+1;
|
||||||
if($lastpage > 19){
|
if($lastpage > 19){
|
||||||
echo " <a href='{$_SERVER['PHP_SELF']}?pageno=$lastpage'>Last>></a> ";
|
echo " <a href='{$_SERVER['PHP_SELF']}?pageno=$lastpage'>Last>></a> ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//next we inform the user of his current position in the sequence of available pages
|
//next we inform the user of his current position in the sequence of available pages
|
||||||
?>
|
?>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user