Compare commits
10 Commits
d932243a26
...
4827746562
| Author | SHA1 | Date | |
|---|---|---|---|
| 4827746562 | |||
| 8b11d513ad | |||
| ff7326b843 | |||
| 4d1b2205c1 | |||
| 0c74c05dc4 | |||
| b58ac82744 | |||
| 67376f0ef6 | |||
| e7bfe401f2 | |||
| 635411b52b | |||
| 9bacd4c2f7 |
@ -35,13 +35,13 @@ form.appnitro
|
||||
padding:0;
|
||||
text-decoration:none;
|
||||
text-indent:-8000px;
|
||||
background-image: url('../../../images/machform.gif');
|
||||
background-repeat: no-repeat;
|
||||
/*background-image: url('../../../images/machform.gif');
|
||||
background-repeat: no-repeat;*/
|
||||
}
|
||||
|
||||
#main_body h1 a
|
||||
{
|
||||
|
||||
|
||||
display:block;
|
||||
height:100%;
|
||||
min-height:40px;
|
||||
@ -193,9 +193,9 @@ form.appnitro
|
||||
|
||||
#main_body .form_description
|
||||
{
|
||||
|
||||
|
||||
display: none;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -249,7 +249,7 @@ form.appnitro
|
||||
{
|
||||
font-size:110%;
|
||||
margin-right:5px;
|
||||
font-family: "Lucida Grande",Tahoma,Arial,Verdana,sans-serif;
|
||||
font-family: "Lucida Grande",Tahoma,Arial,Verdana,sans-serif;
|
||||
}
|
||||
|
||||
/**** Inputs and Labels ****/
|
||||
@ -533,7 +533,7 @@ form.appnitro
|
||||
}
|
||||
|
||||
/*** Success Message ****/
|
||||
.form_success
|
||||
.form_success
|
||||
{
|
||||
clear: both;
|
||||
margin: 0;
|
||||
@ -591,7 +591,7 @@ form.appnitro
|
||||
/** Integrated Form **/
|
||||
.integrated *{
|
||||
font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
|
||||
color: #000;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.integrated #top, .integrated #bottom, .integrated h1{
|
||||
@ -615,7 +615,7 @@ form.appnitro
|
||||
.integrated form.appnitro
|
||||
{
|
||||
margin:0px 0px 0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.integrated form .section_break h3
|
||||
@ -626,7 +626,7 @@ form.appnitro
|
||||
.integrated #error_message h3
|
||||
{
|
||||
border: none !important;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -653,60 +653,60 @@ font-size: 11px;
|
||||
font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
|
||||
}
|
||||
|
||||
.calendar .button {
|
||||
text-align: center;
|
||||
padding: 2px;
|
||||
.calendar .button {
|
||||
text-align: center;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.calendar .nav {
|
||||
background:#f5f5f5;
|
||||
}
|
||||
|
||||
.calendar thead .title {
|
||||
font-weight: bold;
|
||||
.calendar thead .title {
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
background: #dedede;
|
||||
color: #000;
|
||||
padding: 2px 0 3px 0;
|
||||
}
|
||||
|
||||
.calendar thead .headrow {
|
||||
.calendar thead .headrow {
|
||||
background: #f5f5f5;
|
||||
color: #444;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
.calendar thead .daynames {
|
||||
.calendar thead .daynames {
|
||||
background: #fff;
|
||||
color:#333;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
.calendar thead .name {
|
||||
.calendar thead .name {
|
||||
border-bottom: 1px dotted #ccc;
|
||||
padding: 2px;
|
||||
text-align: center;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.calendar thead .weekend {
|
||||
.calendar thead .weekend {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.calendar thead .hilite {
|
||||
.calendar thead .hilite {
|
||||
background-color: #444;
|
||||
color: #fff;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar thead .active {
|
||||
.calendar thead .active {
|
||||
background-color: #d12f19;
|
||||
color:#fff;
|
||||
padding: 2px 0px 0px 2px;
|
||||
}
|
||||
|
||||
|
||||
.calendar tbody .day {
|
||||
.calendar tbody .day {
|
||||
width:1.8em;
|
||||
color: #222;
|
||||
text-align: right;
|
||||
@ -734,19 +734,19 @@ background: #FFF1AF;
|
||||
background: #FFF1AF;
|
||||
}
|
||||
|
||||
.calendar tbody td.hilite {
|
||||
.calendar tbody td.hilite {
|
||||
padding: 1px 1px 1px 1px;
|
||||
background:#444 !important;
|
||||
color:#fff !important;
|
||||
}
|
||||
|
||||
.calendar tbody td.active {
|
||||
.calendar tbody td.active {
|
||||
color:#fff;
|
||||
background: #529214 !important;
|
||||
padding: 2px 2px 0px 2px;
|
||||
}
|
||||
|
||||
.calendar tbody td.selected {
|
||||
.calendar tbody td.selected {
|
||||
font-weight: bold;
|
||||
border: 1px solid #888;
|
||||
padding: 1px 1px 1px 1px;
|
||||
@ -754,11 +754,11 @@ background: #f5f5f5 !important;
|
||||
color: #222 !important;
|
||||
}
|
||||
|
||||
.calendar tbody td.weekend {
|
||||
.calendar tbody td.weekend {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.calendar tbody td.today {
|
||||
.calendar tbody td.today {
|
||||
font-weight: bold;
|
||||
color: #529214;
|
||||
background:#D9EFC2;
|
||||
@ -766,21 +766,21 @@ background:#D9EFC2;
|
||||
|
||||
.calendar tbody .disabled { color: #999; }
|
||||
|
||||
.calendar tbody .emptycell {
|
||||
.calendar tbody .emptycell {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.calendar tbody .emptyrow {
|
||||
.calendar tbody .emptyrow {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.calendar tfoot .footrow {
|
||||
.calendar tfoot .footrow {
|
||||
text-align: center;
|
||||
background: #556;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.calendar tfoot .ttip {
|
||||
.calendar tfoot .ttip {
|
||||
background: #222;
|
||||
color: #fff;
|
||||
font-size:10px;
|
||||
@ -788,14 +788,14 @@ border-top: 1px solid #dedede;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
.calendar tfoot .hilite {
|
||||
.calendar tfoot .hilite {
|
||||
background: #aaf;
|
||||
border: 1px solid #04f;
|
||||
color: #000;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar tfoot .active {
|
||||
.calendar tfoot .active {
|
||||
background: #77c;
|
||||
padding: 2px 0px 0px 2px;
|
||||
}
|
||||
|
||||
360
edit_form.php
@ -1,14 +1,14 @@
|
||||
<?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/
|
||||
******************************************************************************/
|
||||
session_start();
|
||||
|
||||
|
||||
require('config.php');
|
||||
require('includes/check-session.php');
|
||||
require('includes/db-core.php');
|
||||
@ -20,13 +20,13 @@
|
||||
}else{
|
||||
$form_id = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//get data from databae
|
||||
connect_db();
|
||||
|
||||
|
||||
//get form data
|
||||
$query = "select
|
||||
$query = "select
|
||||
form_name,
|
||||
form_description,
|
||||
form_redirect,
|
||||
@ -36,13 +36,13 @@
|
||||
form_captcha,
|
||||
form_review,
|
||||
form_frame_height
|
||||
from
|
||||
ap_forms
|
||||
where
|
||||
from
|
||||
ap_forms
|
||||
where
|
||||
form_id='$form_id'";
|
||||
$result = do_query($query);
|
||||
$row = do_fetch_result($result);
|
||||
|
||||
|
||||
$form = new stdClass();
|
||||
if(!empty($row)){
|
||||
$form->id = $form_id;
|
||||
@ -67,19 +67,19 @@
|
||||
$form->captcha = 0;
|
||||
$form->review = 0;
|
||||
}
|
||||
|
||||
|
||||
//get element options first and store it into array
|
||||
$query = "select
|
||||
$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
|
||||
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)){
|
||||
@ -90,10 +90,10 @@
|
||||
$options_lookup[$element_id][$option_id]['option_is_default'] = $row['option_is_default'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
//get elements data
|
||||
$element = array();
|
||||
$query = "select
|
||||
$query = "select
|
||||
element_id,
|
||||
element_title,
|
||||
element_guidelines,
|
||||
@ -104,18 +104,19 @@
|
||||
element_type,
|
||||
element_position,
|
||||
element_default_value,
|
||||
element_constraint
|
||||
from
|
||||
ap_form_elements
|
||||
where
|
||||
form_id='$form_id'
|
||||
order by
|
||||
element_constraint
|
||||
from
|
||||
ap_form_elements
|
||||
where
|
||||
form_id='$form_id'
|
||||
order by
|
||||
element_position asc";
|
||||
$result = do_query($query);
|
||||
|
||||
$j=0;
|
||||
while($row = do_fetch_result($result)){
|
||||
$element_id = $row['element_id'];
|
||||
|
||||
|
||||
//lookup element options first
|
||||
if(!empty($options_lookup[$element_id])){
|
||||
$element_options = array();
|
||||
@ -129,8 +130,7 @@
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//populate elements
|
||||
$element[$j] = new stdClass();
|
||||
$element[$j]->title = $row['element_title'];
|
||||
@ -150,27 +150,28 @@
|
||||
}else{
|
||||
$element[$j]->options = '';
|
||||
}
|
||||
|
||||
$j++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$json = new Services_JSON();
|
||||
$json_form = $json->encode($form);
|
||||
|
||||
|
||||
|
||||
|
||||
$all_element = array('elements' => $element);
|
||||
|
||||
|
||||
$json_element = $json->encode($all_element);
|
||||
|
||||
|
||||
|
||||
$header_data =<<<EOT
|
||||
<script type="text/javascript" src="js/base.js"></script>
|
||||
<script type="text/javascript" src="js/machform.js"></script>
|
||||
EOT;
|
||||
|
||||
|
||||
$show_status_bar = true; //for header.php
|
||||
|
||||
require('includes/header.php');
|
||||
|
||||
require('includes/header.php');
|
||||
?>
|
||||
|
||||
<div id="main">
|
||||
@ -218,8 +219,8 @@ EOT;
|
||||
<li><a id="number" href="javascript:insert_element('number');"><img src="images/button_text/number.gif" /></a></li>
|
||||
<li><a id="checkboxes" href="javascript:insert_element('checkbox');"><img src="images/button_text/checkboxes.gif" /></a></li>
|
||||
<li><a id="drop_down" href="javascript:insert_element('select');"><img src="images/button_text/drop_down.gif" /></a></li>
|
||||
<li><a id="date" href="javascript:insert_element('date');"><img src="images/button_text/date.gif" /></a></li>
|
||||
<li><a id="phone" href="javascript:insert_element('phone');"><img src="images/button_text/phone.gif" /></a></li>
|
||||
<li><a id="date" href="javascript:insert_element('europe_date');"><img src="images/button_text/date.gif" /></a></li>
|
||||
<li><a id="phone" href="javascript:insert_element('simple_phone');"><img src="images/button_text/phone.gif" /></a></li>
|
||||
<li><a id="web_site" href="javascript:insert_element('url');"><img src="images/button_text/web_site.gif" /></a></li>
|
||||
<li><a id="email" href="javascript:insert_element('email');"><img src="images/button_text/email.gif" /></a></li>
|
||||
<li><a id="file_upload" href="javascript:insert_element('file');"><img src="images/button_text/file_upload.gif" /></a></li>
|
||||
@ -241,7 +242,7 @@ EOT;
|
||||
Etiqueta del campo
|
||||
<a href="#" class="tooltip" title="Etiqueta del campo" rel="La etiqueta del campo se sitúa encima del campo e indica qué información hay que introducir.">(?)</a>
|
||||
</label>
|
||||
<textarea id="element_label" class="textarea"
|
||||
<textarea id="element_label" class="textarea"
|
||||
onkeyup="set_properties(this.value, 'title')"
|
||||
/></textarea><img src="images/icons/arrow_left.gif" id="arrow_left" height="24" width="24" align="top" style="margin-left: 3px;" />
|
||||
</li>
|
||||
@ -254,8 +255,8 @@ Tipo de campo
|
||||
<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="textarea">Párrafo de texto</option>
|
||||
<option value="radio">Selección múltiple</option>
|
||||
<option value="checkbox">Cajas de selección</option>
|
||||
<option value="radio">Botón de opciones</option>
|
||||
<option value="checkbox">Casillas de selección</option>
|
||||
<option value="select">Lista desplegable</option>
|
||||
<option value="number">Número</option>
|
||||
<option value="simple_name">Nombre</option>
|
||||
@ -289,8 +290,8 @@ Formato de fecha
|
||||
<a href="#" class="tooltip" title="Formato de fecha" rel="Puede elegir entre formato de fecha americano y europeo">(?)</a>
|
||||
</label>
|
||||
<select class="select full" id="date_type" autocomplete="off" onchange="set_properties(JJ(this).val(), 'type')">
|
||||
<option id="element_date" value="date">MM / DD / YYYY</option>
|
||||
<option id="element_europe_date" value="europe_date">DD / MM / YYYY</option>
|
||||
<option id="element_europe_date" value="europe_date">DD / MM / AAAA</option>
|
||||
<option id="element_date" value="date">MM / DD / AAAA</option>
|
||||
</select>
|
||||
</li>
|
||||
|
||||
@ -311,8 +312,8 @@ Formato de teléfono
|
||||
<a href="#" class="tooltip" title="Formato de teléfono" rel="Puede elegir entre formato de fecha americano o internacional">(?)</a>
|
||||
</label>
|
||||
<select class="select full" id="phone_format" autocomplete="off" onchange="set_properties(JJ(this).val(), 'type')">
|
||||
<option id="element_phone" value="phone">(###) ### - ####</option>
|
||||
<option id="element_simple_phone" value="simple_phone">Internacional</option>
|
||||
<option id="element_phone" value="phone">(###) ### - ####</option>
|
||||
</select>
|
||||
</li>
|
||||
|
||||
@ -346,8 +347,8 @@ Opciones
|
||||
<label class="choice" for="element_required">Obligatorio</label>
|
||||
<a href="#" class="tooltip" title="Obligatorio" rel="Marcando esta restricción, el usuario tendrá que rellenar este campo obligatoriamente y se le avisará para que lo haga en caso de que lo deje en blanco.">(?)</a><br>
|
||||
<span id="element_unique_span">
|
||||
<input id="element_unique" class="checkbox" value="" tabindex="15" onchange="(this.checked) ? checkVal = '1' : checkVal = '0';set_properties(checkVal, 'is_unique')" type="checkbox">
|
||||
<label class="choice" for="element_unique">Sin duplicados</label>
|
||||
<input id="element_unique" class="checkbox" value="" tabindex="15" onchange="(this.checked) ? checkVal = '1' : checkVal = '0';set_properties(checkVal, 'is_unique')" type="checkbox">
|
||||
<label class="choice" for="element_unique">Sin duplicados</label>
|
||||
<a href="#" class="tooltip" title="Sin duplicados" rel="Marcando esta restricción, se comprobará que los datos introducidos en este campo son únicos y no se han introducidor anteriormente.">(?)</a></span><br>
|
||||
</fieldset>
|
||||
</li>
|
||||
@ -404,42 +405,42 @@ País predeterminado
|
||||
<optgroup label="América del Norte y Central">
|
||||
<option value="Antigua and Barbuda">Antigua y Barbuda</option>
|
||||
<option value="Bahamas">Bahamas</option>
|
||||
<option value="Barbados">Barbados</option>
|
||||
<option value="Belize">Belice</option>
|
||||
<option value="Canada">Canadá</option>
|
||||
<option value="Costa Rica">Costa Rica</option>
|
||||
<option value="Cuba">Cuba</option>
|
||||
<option value="Dominica">Mancomunidad de Dominica</option>
|
||||
<option value="Barbados">Barbados</option>
|
||||
<option value="Belize">Belice</option>
|
||||
<option value="Canada">Canadá</option>
|
||||
<option value="Costa Rica">Costa Rica</option>
|
||||
<option value="Cuba">Cuba</option>
|
||||
<option value="Dominica">Mancomunidad de Dominica</option>
|
||||
<option value="El Salvador">El Salvador</option>
|
||||
<option value="United States">Estados Unidos</option>
|
||||
<option value="Grenada">Granada</option>
|
||||
<option value="Guatemala">Guatemala</option>
|
||||
<option value="Haiti">Haití</option>
|
||||
<option value="Honduras">Honduras</option>
|
||||
<option value="Jamaica">Jamaica</option>
|
||||
<option value="Mexico">México</option>
|
||||
<option value="Nicaragua">Nicaragua</option>
|
||||
<option value="Panama">Panamá</option>
|
||||
<option value="Puerto Rico">Puerto Rico</option>
|
||||
<option value="Grenada">Granada</option>
|
||||
<option value="Guatemala">Guatemala</option>
|
||||
<option value="Haiti">Haití</option>
|
||||
<option value="Honduras">Honduras</option>
|
||||
<option value="Jamaica">Jamaica</option>
|
||||
<option value="Mexico">México</option>
|
||||
<option value="Nicaragua">Nicaragua</option>
|
||||
<option value="Panama">Panamá</option>
|
||||
<option value="Puerto Rico">Puerto Rico</option>
|
||||
<option value="Dominican Republic">República Dominicana</option>
|
||||
<option value="Saint Kitts and Nevis">San Cristóbal y Nieves</option>
|
||||
<option value="Saint Kitts and Nevis">San Cristóbal y Nieves</option>
|
||||
<option value="Saint Lucia">Santa Lucía</option>
|
||||
<option value="Saint Vincent and the Grenadines">San Vicente y las Granadinas</option>
|
||||
<option value="Saint Vincent and the Grenadines">San Vicente y las Granadinas</option>
|
||||
<option value="Trinidad and Tobago">Trinidad y Tobago</option>
|
||||
</optgroup>
|
||||
|
||||
<optgroup label="América del Sur">
|
||||
<option value="Argentina">Argentina</option>
|
||||
<option value="Bolivia">Bolivia</option>
|
||||
<option value="Brazil">Brasil</option>
|
||||
<option value="Chile">Chile</option>
|
||||
<option value="Bolivia">Bolivia</option>
|
||||
<option value="Brazil">Brasil</option>
|
||||
<option value="Chile">Chile</option>
|
||||
<option value="Columbia">Colombia</option>
|
||||
<option value="Ecuador">Ecuador</option>
|
||||
<option value="Guyana">Guyana</option>
|
||||
<option value="Paraguay">Paraguay</option>
|
||||
<option value="Peru">Perú</option>
|
||||
<option value="Suriname">Surinam</option>
|
||||
<option value="Uruguay">Uruguay</option>
|
||||
<option value="Ecuador">Ecuador</option>
|
||||
<option value="Guyana">Guyana</option>
|
||||
<option value="Paraguay">Paraguay</option>
|
||||
<option value="Peru">Perú</option>
|
||||
<option value="Suriname">Surinam</option>
|
||||
<option value="Uruguay">Uruguay</option>
|
||||
<option value="Venezuela">Venezuela</option>
|
||||
</optgroup>
|
||||
|
||||
@ -450,47 +451,47 @@ País predeterminado
|
||||
<option value="Armenia">Armenia</option>
|
||||
<option value="Austria">Austria</option>
|
||||
<option value="Azerbaijan">Azerbaiyán</option>
|
||||
<option value="Belgium">Bélgica</option>
|
||||
<option value="Belgium">Bélgica</option>
|
||||
<option value="Belarus">Bielorrusia</option>
|
||||
<option value="Bosnia and Herzegovina">Bosnia y Herzegovina</option>
|
||||
<option value="Bulgaria">Bulgaria</option>
|
||||
<option value="Bulgaria">Bulgaria</option>
|
||||
<option value="Vatican City">Ciudad del Vaticano</option>
|
||||
<option value="Croatia">Croacia</option>
|
||||
<option value="Cyprus">Chipre</option>
|
||||
<option value="Denmark">Dinamarca</option>
|
||||
<option value="Croatia">Croacia</option>
|
||||
<option value="Cyprus">Chipre</option>
|
||||
<option value="Denmark">Dinamarca</option>
|
||||
<option value="Slovakia">Eslovaquia</option>
|
||||
<option value="Slovenia">Eslovenia</option>
|
||||
<option value="Spain">España</option>
|
||||
<option value="Estonia">Estonia</option>
|
||||
<option value="Finland">Finlandia</option>
|
||||
<option value="France">Francia</option>
|
||||
<option value="Slovenia">Eslovenia</option>
|
||||
<option value="Spain">España</option>
|
||||
<option value="Estonia">Estonia</option>
|
||||
<option value="Finland">Finlandia</option>
|
||||
<option value="France">Francia</option>
|
||||
<option value="Georgia">Georgia</option>
|
||||
<option value="Greece">Grecia</option>
|
||||
<option value="Hungary">Hungría</option>
|
||||
<option value="Iceland">Islandia</option>
|
||||
<option value="Ireland">Irlanda</option>
|
||||
<option value="Italy">Italia</option>
|
||||
<option value="Latvia">Letonia</option>
|
||||
<option value="Greece">Grecia</option>
|
||||
<option value="Hungary">Hungría</option>
|
||||
<option value="Iceland">Islandia</option>
|
||||
<option value="Ireland">Irlanda</option>
|
||||
<option value="Italy">Italia</option>
|
||||
<option value="Latvia">Letonia</option>
|
||||
<option value="Liechtenstein">Liechtenstein</option>
|
||||
<option value="Lithuania">Lituania</option>
|
||||
<option value="Luxembourg">Luxemburgo</option>
|
||||
<option value="Macedonia">Macedonia</option>
|
||||
<option value="Malta">Malta</option>
|
||||
<option value="Moldova">Moldavia</option>
|
||||
<option value="Monaco">Mónaco</option>
|
||||
<option value="Montenegro">Montenegro</option>
|
||||
<option value="Norway">Noruega</option>
|
||||
<option value="Netherlands">Países Bajos</option>
|
||||
<option value="Poland">Polonia</option>
|
||||
<option value="Lithuania">Lituania</option>
|
||||
<option value="Luxembourg">Luxemburgo</option>
|
||||
<option value="Macedonia">Macedonia</option>
|
||||
<option value="Malta">Malta</option>
|
||||
<option value="Moldova">Moldavia</option>
|
||||
<option value="Monaco">Mónaco</option>
|
||||
<option value="Montenegro">Montenegro</option>
|
||||
<option value="Norway">Noruega</option>
|
||||
<option value="Netherlands">Países Bajos</option>
|
||||
<option value="Poland">Polonia</option>
|
||||
<option value="Portugal">Portugal</option>
|
||||
<option value="United Kingdom">Reino Unido</option>
|
||||
<option value="Czech Republic">República Checa</option>
|
||||
<option value="Romania">Rumanía</option>
|
||||
<option value="Romania">Rumanía</option>
|
||||
<option value="San Marino">San Marino</option>
|
||||
<option value="Serbia">Serbia</option>
|
||||
<option value="Sweden">Suecia</option>
|
||||
<option value="Switzerland">Suiza</option>
|
||||
<option value="Ukraine">Ucrania</option>
|
||||
<option value="Sweden">Suecia</option>
|
||||
<option value="Switzerland">Suiza</option>
|
||||
<option value="Ukraine">Ucrania</option>
|
||||
</optgroup>
|
||||
|
||||
<optgroup label="Asia">
|
||||
@ -503,7 +504,7 @@ País predeterminado
|
||||
<option value="Cambodia">Camboya</option>
|
||||
<option value="China">China</option>
|
||||
<option value="East Timor">Timor Oriental</option>
|
||||
<option value="Hong Kong">Hong Kong</option>
|
||||
<option value="Hong Kong">Hong Kong</option>
|
||||
<option value="India">India</option>
|
||||
<option value="Indonesia">Indonesia</option>
|
||||
<option value="Iran">Irán</option>
|
||||
@ -514,103 +515,103 @@ País predeterminado
|
||||
<option value="Kazakhstan">Kazajistán</option>
|
||||
<option value="North Korea">Corea del Norte</option>
|
||||
<option value="South Korea">Corea del Sur</option>
|
||||
<option value="Kuwait">Kuwait</option>
|
||||
<option value="Kyrgyzstan">Kirguistán</option>
|
||||
<option value="Laos">Laos</option>
|
||||
<option value="Lebanon">Líbano</option>
|
||||
<option value="Malaysia">Malasia</option>
|
||||
<option value="Maldives">Maldivas</option>
|
||||
<option value="Mongolia">Mongolia</option>
|
||||
<option value="Nepal">Nepal</option>
|
||||
<option value="Oman">Omán</option>
|
||||
<option value="Pakistan">Pakistán</option>
|
||||
<option value="Philippines">Filipinas</option>
|
||||
<option value="Qatar">Catar</option>
|
||||
<option value="Russia">Rusia</option>
|
||||
<option value="Saudi Arabia">Arabia Saudita</option>
|
||||
<option value="Singapore">Singapur</option>
|
||||
<option value="Kuwait">Kuwait</option>
|
||||
<option value="Kyrgyzstan">Kirguistán</option>
|
||||
<option value="Laos">Laos</option>
|
||||
<option value="Lebanon">Líbano</option>
|
||||
<option value="Malaysia">Malasia</option>
|
||||
<option value="Maldives">Maldivas</option>
|
||||
<option value="Mongolia">Mongolia</option>
|
||||
<option value="Nepal">Nepal</option>
|
||||
<option value="Oman">Omán</option>
|
||||
<option value="Pakistan">Pakistán</option>
|
||||
<option value="Philippines">Filipinas</option>
|
||||
<option value="Qatar">Catar</option>
|
||||
<option value="Russia">Rusia</option>
|
||||
<option value="Saudi Arabia">Arabia Saudita</option>
|
||||
<option value="Singapore">Singapur</option>
|
||||
<option value="Sri Lanka">Sri Lanka</option>
|
||||
<option value="Syria">Siria</option>
|
||||
<option value="Taiwan">Taiwán</option>
|
||||
<option value="Tajikistan">Tayikistán</option>
|
||||
<option value="Thailand">Tailandia</option>
|
||||
<option value="Turkey">Turquía</option>
|
||||
<option value="Turkmenistan">Turkmenistán</option>
|
||||
<option value="Taiwan">Taiwán</option>
|
||||
<option value="Tajikistan">Tayikistán</option>
|
||||
<option value="Thailand">Tailandia</option>
|
||||
<option value="Turkey">Turquía</option>
|
||||
<option value="Turkmenistan">Turkmenistán</option>
|
||||
<option value="United Arab Emirates">Emiratos Árabes Unidos</option>
|
||||
<option value="Uzbekistan">Uzbekistán</option>
|
||||
<option value="Vietnam">Vietnam</option>
|
||||
<option value="Uzbekistan">Uzbekistán</option>
|
||||
<option value="Vietnam">Vietnam</option>
|
||||
<option value="Yemen">Yemen</option>
|
||||
</optgroup>
|
||||
|
||||
<optgroup label="Oceania">
|
||||
<option value="Australia">Australia</option>
|
||||
<option value="Fiji">Fiji</option>
|
||||
<option value="Fiji">Fiji</option>
|
||||
<option value="Kiribati">Kiribati</option>
|
||||
<option value="Marshall Islands">Islas Marshall</option>
|
||||
<option value="Micronesia">Micronesia</option>
|
||||
<option value="Nauru">Nauru</option>
|
||||
<option value="Marshall Islands">Islas Marshall</option>
|
||||
<option value="Micronesia">Micronesia</option>
|
||||
<option value="Nauru">Nauru</option>
|
||||
<option value="New Zealand">Nueva Zelanda</option>
|
||||
<option value="Palau">Palau</option>
|
||||
<option value="Papua New Guinea">Papúa Nueva Guinea</option>
|
||||
<option value="Samoa">Samoa</option>
|
||||
<option value="Samoa">Samoa</option>
|
||||
<option value="Solomon Islands">Islas Solomón</option>
|
||||
<option value="Tonga">Tonga</option>
|
||||
<option value="Tuvalu">Tuvalu</option>
|
||||
<option value="Tonga">Tonga</option>
|
||||
<option value="Tuvalu">Tuvalu</option>
|
||||
<option value="Vanuatu">Vanuatu</option>
|
||||
</optgroup>
|
||||
|
||||
<optgroup label="África">
|
||||
<option value="Algeria">Argelia</option>
|
||||
<option value="Angola">Angola</option>
|
||||
<option value="Benin">Benin</option>
|
||||
<option value="Botswana">Botswana</option>
|
||||
<option value="Burkina Faso">Burkina Faso</option>
|
||||
<option value="Burundi">Burundi</option>
|
||||
<option value="Cameroon">Camerún</option>
|
||||
<option value="Algeria">Argelia</option>
|
||||
<option value="Angola">Angola</option>
|
||||
<option value="Benin">Benin</option>
|
||||
<option value="Botswana">Botswana</option>
|
||||
<option value="Burkina Faso">Burkina Faso</option>
|
||||
<option value="Burundi">Burundi</option>
|
||||
<option value="Cameroon">Camerún</option>
|
||||
<option value="Cape Verde">Cabo Verde</option>
|
||||
<option value="Central African Republic">República Centroafricana</option>
|
||||
<option value="Chad">Chad</option>
|
||||
<option value="Comoros">Comoras</option>
|
||||
<option value="Chad">Chad</option>
|
||||
<option value="Comoros">Comoras</option>
|
||||
<option value="Congo">Congo</option>
|
||||
<option value="Djibouti">Djibouti</option>
|
||||
<option value="Egypt">Egipto</option>
|
||||
<option value="Equatorial Guinea">Guinea Ecuatorial</option>
|
||||
<option value="Eritrea">Eritrea</option>
|
||||
<option value="Ethiopia">Etiopía</option>
|
||||
<option value="Gabon">Gabón</option>
|
||||
<option value="Gambia">Gambia</option>
|
||||
<option value="Ghana">Ghana</option>
|
||||
<option value="Guinea">Guinea</option>
|
||||
<option value="Djibouti">Djibouti</option>
|
||||
<option value="Egypt">Egipto</option>
|
||||
<option value="Equatorial Guinea">Guinea Ecuatorial</option>
|
||||
<option value="Eritrea">Eritrea</option>
|
||||
<option value="Ethiopia">Etiopía</option>
|
||||
<option value="Gabon">Gabón</option>
|
||||
<option value="Gambia">Gambia</option>
|
||||
<option value="Ghana">Ghana</option>
|
||||
<option value="Guinea">Guinea</option>
|
||||
<option value="Guinea-Bissau">Guinea-Bissau</option>
|
||||
<option value="Côte d'Ivoire">Côte d'Ivoire</option>
|
||||
<option value="Kenya">Kenya</option>
|
||||
<option value="Lesotho">Lesotho</option>
|
||||
<option value="Liberia">Liberia</option>
|
||||
<option value="Libya">Libia</option>
|
||||
<option value="Madagascar">Madagascar</option>
|
||||
<option value="Malawi">Malawi</option>
|
||||
<option value="Côte d'Ivoire">Côte d'Ivoire</option>
|
||||
<option value="Kenya">Kenya</option>
|
||||
<option value="Lesotho">Lesotho</option>
|
||||
<option value="Liberia">Liberia</option>
|
||||
<option value="Libya">Libia</option>
|
||||
<option value="Madagascar">Madagascar</option>
|
||||
<option value="Malawi">Malawi</option>
|
||||
<option value="Mali">Malí</option>
|
||||
<option value="Mauritania">Mauritania</option>
|
||||
<option value="Mauritius">Mauricio</option>
|
||||
<option value="Morocco">Marruecos</option>
|
||||
<option value="Mozambique">Mozambique</option>
|
||||
<option value="Mauritania">Mauritania</option>
|
||||
<option value="Mauritius">Mauricio</option>
|
||||
<option value="Morocco">Marruecos</option>
|
||||
<option value="Mozambique">Mozambique</option>
|
||||
<option value="Namibia">Namibia</option>
|
||||
<option value="Niger">Níger</option>
|
||||
<option value="Nigeria">Nigeria</option>
|
||||
<option value="Rwanda">Ruanda</option>
|
||||
<option value="Nigeria">Nigeria</option>
|
||||
<option value="Rwanda">Ruanda</option>
|
||||
<option value="Sao Tome and Principe">Santo Tomé y Príncipe</option>
|
||||
<option value="Senegal">Senegal</option>
|
||||
<option value="Seychelles">Seychelles</option>
|
||||
<option value="Senegal">Senegal</option>
|
||||
<option value="Seychelles">Seychelles</option>
|
||||
<option value="Sierra Leone">Sierra Leona</option>
|
||||
<option value="Somalia">Somalia</option>
|
||||
<option value="Somalia">Somalia</option>
|
||||
<option value="South Africa">Sudáfrica</option>
|
||||
<option value="Sudan">Sudán</option>
|
||||
<option value="Swaziland">Suazilandia</option>
|
||||
<option value="Sudan">Sudán</option>
|
||||
<option value="Swaziland">Suazilandia</option>
|
||||
<option value="United Republic of Tanzania">Tanzania</option>
|
||||
<option value="Togo">Togo</option>
|
||||
<option value="Tunisia">Túnez</option>
|
||||
<option value="Uganda">Uganda</option>
|
||||
<option value="Zambia">Zambia</option>
|
||||
<option value="Togo">Togo</option>
|
||||
<option value="Tunisia">Túnez</option>
|
||||
<option value="Uganda">Uganda</option>
|
||||
<option value="Zambia">Zambia</option>
|
||||
<option value="Zimbabwe">Zimbabue</option>
|
||||
</optgroup>
|
||||
</select>
|
||||
@ -622,7 +623,7 @@ Valor predeterminado
|
||||
<a href="#" class="tooltip" title="Default Value" rel="Al mostrar el formulario, este campo se rellenará con el valor que se indique aquí.">(?)</a>
|
||||
</label>
|
||||
|
||||
( <input id="element_phone_default1" class="text" size="3" name="text" value="" tabindex="11" maxlength="3" onkeyup="set_properties(JJ('#element_phone_default1').val().toString()+JJ('#element_phone_default2').val().toString()+JJ('#element_phone_default3').val().toString(), 'default_value')" onblur="set_properties(JJ('#element_phone_default1').val().toString()+JJ('#element_phone_default2').val().toString()+JJ('#element_phone_default3').val().toString(), 'default_value')" type="text"> )
|
||||
( <input id="element_phone_default1" class="text" size="3" name="text" value="" tabindex="11" maxlength="3" onkeyup="set_properties(JJ('#element_phone_default1').val().toString()+JJ('#element_phone_default2').val().toString()+JJ('#element_phone_default3').val().toString(), 'default_value')" onblur="set_properties(JJ('#element_phone_default1').val().toString()+JJ('#element_phone_default2').val().toString()+JJ('#element_phone_default3').val().toString(), 'default_value')" type="text"> )
|
||||
|
||||
<input id="element_phone_default2" class="text" size="3" name="text" value="" tabindex="11" maxlength="3" onkeyup="set_properties(JJ('#element_phone_default1').val().toString()+JJ('#element_phone_default2').val().toString()+JJ('#element_phone_default3').val().toString(), 'default_value')" onblur="set_properties(JJ('#element_phone_default1').val().toString()+JJ('#element_phone_default2').val().toString()+JJ('#element_phone_default3').val().toString(), 'default_value')" type="text"> -
|
||||
<input id="element_phone_default3" class="text" size="4" name="text" value="" tabindex="11" maxlength="4" onkeyup="set_properties(JJ('#element_phone_default1').val().toString()+JJ('#element_phone_default2').val().toString()+JJ('#element_phone_default3').val().toString(), 'default_value')" onblur="set_properties(JJ('#element_phone_default1').val().toString()+JJ('#element_phone_default2').val().toString()+JJ('#element_phone_default3').val().toString(), 'default_value')" type="text">
|
||||
@ -691,7 +692,7 @@ Instrucciones para los usuarios
|
||||
<div class="left">
|
||||
<input id="form_success_message_option" name="confirmation" class="radio" value="" checked="checked" tabindex="8" onclick="update_form('', 'redirect'); Element.removeClassName('form_success_message', 'hide');Element.addClassName('form_redirect_url', 'hide')" type="radio">
|
||||
<label class="choice" for="form_success_message_option">Mostrar mensaje</label>
|
||||
<a class="tooltip" title="Success Message" rel="Se mostrará el mensaje que se indique después de que los usuarios hayan enviado sus respuestas.">(?)</a>
|
||||
<a class="tooltip" title="Mensaje a mostrar después del envio" rel="Se mostrará el mensaje que se indique después de que los usuarios hayan enviado sus respuestas.">(?)</a>
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
@ -707,14 +708,15 @@ Instrucciones para los usuarios
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
<?php
|
||||
$footer_data =<<<EOT
|
||||
<script type="text/javascript">
|
||||
var json_form = {$json_form};
|
||||
var json_elements = {$json_element};
|
||||
</script>
|
||||
EOT;
|
||||
require('includes/footer.php');
|
||||
require('includes/footer.php');
|
||||
?>
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
<?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/
|
||||
******************************************************************************/
|
||||
session_start();
|
||||
session_start();
|
||||
|
||||
require('config.php');
|
||||
require('includes/language.php');
|
||||
@ -16,13 +16,13 @@
|
||||
require('includes/db-functions.php');
|
||||
require('includes/helper-functions.php');
|
||||
require('includes/filter-functions.php');
|
||||
|
||||
|
||||
connect_db();
|
||||
|
||||
|
||||
$form_id = (int) trim($_REQUEST['id']);
|
||||
|
||||
|
||||
//get form name and properties
|
||||
$query = "select
|
||||
$query = "select
|
||||
form_name,
|
||||
form_email,
|
||||
esl_from_name,
|
||||
@ -35,14 +35,14 @@
|
||||
esr_from_email_address,
|
||||
esr_subject,
|
||||
esr_content,
|
||||
esr_plain_text
|
||||
from
|
||||
`ap_forms`
|
||||
where
|
||||
esr_plain_text
|
||||
from
|
||||
`ap_forms`
|
||||
where
|
||||
form_id='$form_id'";
|
||||
$result = do_query($query);
|
||||
$row = do_fetch_result($result);
|
||||
|
||||
|
||||
$form_name = htmlspecialchars($row['form_name']);
|
||||
$form_email = htmlspecialchars($row['form_email']);
|
||||
$esl_from_name = htmlspecialchars($row['esl_from_name']);
|
||||
@ -56,16 +56,16 @@
|
||||
$esr_subject = htmlspecialchars($row['esr_subject']);
|
||||
$esr_content = htmlspecialchars($row['esr_content'],ENT_QUOTES);
|
||||
$esr_plain_text = htmlspecialchars($row['esr_plain_text']);
|
||||
|
||||
|
||||
//get email fields for this form
|
||||
$query = "select
|
||||
$query = "select
|
||||
element_id,
|
||||
element_title
|
||||
from
|
||||
`ap_form_elements`
|
||||
where
|
||||
form_id='{$form_id}' and element_type='email' and element_is_private=0
|
||||
order by
|
||||
element_title
|
||||
from
|
||||
`ap_form_elements`
|
||||
where
|
||||
form_id='{$form_id}' and element_type='email' and element_is_private=0
|
||||
order by
|
||||
element_position asc";
|
||||
$result = do_query($query);
|
||||
$i=0;
|
||||
@ -75,8 +75,8 @@
|
||||
$email_fields[$i]['value'] = $row['element_id'];
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//start left form handler --------
|
||||
if(NOTIFICATION_MAIL_FROM != ''){
|
||||
$esl_email_fields[0]['label'] = NOTIFICATION_MAIL_FROM;
|
||||
@ -86,30 +86,30 @@
|
||||
$esl_email_fields[0]['label'] = "no-reply@{$domain}";
|
||||
$esl_email_fields[0]['value'] = "no-reply@{$domain}";
|
||||
}
|
||||
|
||||
|
||||
$esl_email_fields = array_merge($esl_email_fields,$email_fields);
|
||||
$esl_valid_email = true;
|
||||
|
||||
|
||||
if(!empty($_POST['esl_submit'])){
|
||||
unset($_POST['esl_submit']);
|
||||
$input_array = ap_sanitize_input($_POST);
|
||||
|
||||
|
||||
//validate for valid email address
|
||||
if(!empty($input_array['esl_email_address'])){
|
||||
|
||||
|
||||
$esl_emails = explode(',',$input_array['esl_email_address']);
|
||||
$regex = '/^[A-z0-9][\w.-]*@[A-z0-9][\w\-\.]+\.[A-z0-9]{2,6}$/';
|
||||
foreach ($esl_emails as $email){
|
||||
$email = trim($email);
|
||||
$result = preg_match($regex, $email);
|
||||
|
||||
|
||||
if(empty($result)){
|
||||
$esl_valid_email = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//if passed, store into database
|
||||
if($esl_valid_email){
|
||||
$esl_input['form_email'] = $input_array['esl_email_address'];
|
||||
@ -118,39 +118,39 @@
|
||||
$esl_input['esl_subject'] = $input_array['esl_subject'];
|
||||
$esl_input['esl_content'] = $input_array['esl_content'];
|
||||
$esl_input['esl_plain_text'] = $input_array['esl_plain_text'];
|
||||
|
||||
|
||||
if(empty($esl_input['esl_plain_text'])){
|
||||
$esl_input['esl_plain_text'] = 0;
|
||||
}
|
||||
|
||||
|
||||
//create the sql update string
|
||||
foreach ($esl_input as $key=>$value){
|
||||
$value = mysql_real_escape_string($value);
|
||||
$update_values .= "`$key`='$value',";
|
||||
}
|
||||
$update_values = substr($update_values,0,-1);
|
||||
|
||||
$query = "UPDATE `ap_forms` set
|
||||
|
||||
$query = "UPDATE `ap_forms` set
|
||||
$update_values
|
||||
where
|
||||
where
|
||||
form_id='{$form_id}';";
|
||||
|
||||
|
||||
do_query($query);
|
||||
|
||||
|
||||
$_SESSION['AP_SUCCESS']['title'] = 'Completado';
|
||||
$_SESSION['AP_SUCCESS']['desc'] = 'Los ajustes de las notificaciones se han guardado.';
|
||||
|
||||
|
||||
header("Location: email_settings.php?id={$form_id}");
|
||||
exit;
|
||||
}else{
|
||||
$_SESSION['AP_ERROR']['title'] = $lang['error_title'];
|
||||
$_SESSION['AP_ERROR']['desc'] = $lang['error_desc'];
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
//populate current values or default values
|
||||
$_POST['esl_email_address'] = $form_email;
|
||||
|
||||
|
||||
if(!empty($esl_from_name)){
|
||||
$_POST['esl_from_name'] = $esl_from_name;
|
||||
}elseif (NOTIFICATION_MAIL_FROM_NAME != ''){
|
||||
@ -158,9 +158,9 @@
|
||||
}else{
|
||||
$_POST['esl_from_name'] = '';
|
||||
}
|
||||
|
||||
|
||||
$_POST['esl_from_email_address'] = $esl_from_email_address;
|
||||
|
||||
|
||||
if(!empty($esl_subject)){
|
||||
$_POST['esl_subject'] = $esl_subject;
|
||||
}elseif (NOTIFICATION_MAIL_SUBJECT != ''){
|
||||
@ -168,38 +168,38 @@
|
||||
}else{
|
||||
$_POST['esl_subject'] = '{form_name} [#{entry_no}]';
|
||||
}
|
||||
|
||||
|
||||
if(!empty($esl_content)){
|
||||
$_POST['esl_content'] = $esl_content;
|
||||
}else{
|
||||
$_POST['esl_content'] = '{entry_data}';
|
||||
}
|
||||
|
||||
|
||||
$_POST['esl_plain_text'] = $esl_plain_text;
|
||||
$_POST['esl_options_expand'] = 0;
|
||||
}
|
||||
//end left form handler --------
|
||||
|
||||
|
||||
//start right form handler --------
|
||||
$esr_email_fields = $email_fields;
|
||||
$esr_valid_email = true;
|
||||
|
||||
|
||||
if(!empty($_POST['esr_submit'])){
|
||||
unset($_POST['esr_submit']);
|
||||
$input_array = ap_sanitize_input($_POST);
|
||||
|
||||
|
||||
//validate for valid email address
|
||||
if(!empty($input_array['esr_from_email_address'])){
|
||||
$regex = '/^[A-z0-9][\w.-]*@[A-z0-9][\w\-\.]+\.[A-z0-9]{2,6}$/';
|
||||
$email = trim($input_array['esr_from_email_address']);
|
||||
$result = preg_match($regex, $email);
|
||||
|
||||
|
||||
if(empty($result)){
|
||||
$esr_valid_email = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//if passed, store into database
|
||||
if($esr_valid_email){
|
||||
$esr_input['esr_email_address'] = $input_array['esr_email_address'];
|
||||
@ -208,28 +208,28 @@
|
||||
$esr_input['esr_subject'] = $input_array['esr_subject'];
|
||||
$esr_input['esr_content'] = $input_array['esr_content'];
|
||||
$esr_input['esr_plain_text'] = $input_array['esr_plain_text'];
|
||||
|
||||
|
||||
if(empty($esr_input['esr_plain_text'])){
|
||||
$esr_input['esr_plain_text'] = 0;
|
||||
}
|
||||
|
||||
|
||||
//create the sql update string
|
||||
foreach ($esr_input as $key=>$value){
|
||||
$value = mysql_real_escape_string($value);
|
||||
$update_values .= "`$key`='$value',";
|
||||
}
|
||||
$update_values = substr($update_values,0,-1);
|
||||
|
||||
$query = "UPDATE `ap_forms` set
|
||||
|
||||
$query = "UPDATE `ap_forms` set
|
||||
$update_values
|
||||
where
|
||||
where
|
||||
form_id='{$form_id}';";
|
||||
|
||||
|
||||
do_query($query);
|
||||
|
||||
|
||||
$_SESSION['AP_SUCCESS']['title'] = 'Completado';
|
||||
$_SESSION['AP_SUCCESS']['desc'] = 'Los ajustes de las notificaciones se han guardado.';
|
||||
|
||||
|
||||
header("Location: email_settings.php?id={$form_id}");
|
||||
exit;
|
||||
}else{
|
||||
@ -240,7 +240,7 @@
|
||||
}else{
|
||||
//populate current values or default values
|
||||
$_POST['esr_email_address'] = $esr_email_address;
|
||||
|
||||
|
||||
if(!empty($esr_from_name)){
|
||||
$_POST['esr_from_name'] = $esr_from_name;
|
||||
}elseif (NOTIFICATION_MAIL_FROM_NAME != ''){
|
||||
@ -248,7 +248,7 @@
|
||||
}else{
|
||||
$_POST['esr_from_name'] = '';
|
||||
}
|
||||
|
||||
|
||||
if(!empty($esr_from_email_address)){
|
||||
$_POST['esr_from_email_address'] = $esr_from_email_address;
|
||||
}elseif(NOTIFICATION_MAIL_FROM != ''){
|
||||
@ -257,61 +257,61 @@
|
||||
$domain = str_replace('www.','',$_SERVER['SERVER_NAME']);
|
||||
$_POST['esr_from_email_address'] = "no-reply@{$domain}";
|
||||
}
|
||||
|
||||
|
||||
if(!empty($esr_subject)){
|
||||
$_POST['esr_subject'] = $esr_subject;
|
||||
}else{
|
||||
$_POST['esr_subject'] = '{form_name} - Receipt';
|
||||
}
|
||||
|
||||
|
||||
if(!empty($esr_content)){
|
||||
$_POST['esr_content'] = $esr_content;
|
||||
}else{
|
||||
$_POST['esr_content'] = '{entry_data}';
|
||||
}
|
||||
|
||||
|
||||
$_POST['esr_plain_text'] = $esr_plain_text;
|
||||
$_POST['esr_options_expand'] = 0;
|
||||
|
||||
|
||||
}
|
||||
//end right form handler ---------
|
||||
|
||||
|
||||
if(!empty($_POST['esl_options_expand'])){
|
||||
$esl_style = '<style>.esl_options{ display: block; } </style>';
|
||||
}
|
||||
|
||||
|
||||
if(!empty($_POST['esr_options_expand'])){
|
||||
$esr_style = '<style>.esr_options{ display: block; } </style>';
|
||||
}
|
||||
|
||||
|
||||
$header_data =<<<EOT
|
||||
<link rel="stylesheet" href="email_settings.css" type="text/css">
|
||||
<script type="text/javascript" src="js/view.js"></script>
|
||||
<script type="text/javascript" src="js/jquery/jquery-core.js"></script>
|
||||
<script>
|
||||
function toggle_esl_options(){
|
||||
if($("#esl_toggle").text() == "more options"){
|
||||
if($("#esl_toggle").text() == "más opciones"){
|
||||
$(".esl_options").slideDown("slow");
|
||||
$("#esl_toggle").text("hide options");
|
||||
$("#esl_toggle").text("ocultar opciones");
|
||||
$("#esl_toggle_img").attr("src","images/icons/resultset_up.gif");
|
||||
$("#esl_options_expand").val("1");
|
||||
}else{
|
||||
$(".esl_options").fadeOut("slow");
|
||||
$("#esl_toggle").text("more options");
|
||||
$("#esl_toggle").text("más opciones");
|
||||
$("#esl_toggle_img").attr("src","images/icons/resultset_next.gif");
|
||||
$("#esl_options_expand").val("0");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function toggle_esr_options(){
|
||||
if($("#esr_toggle").text() == "more options"){
|
||||
if($("#esr_toggle").text() == "más opciones"){
|
||||
$(".esr_options").slideDown("slow");
|
||||
$("#esr_toggle").text("hide options");
|
||||
$("#esr_toggle").text("ocultar opciones");
|
||||
$("#esr_toggle_img").attr("src","images/icons/resultset_up.gif");
|
||||
$("#esr_options_expand").val("1");
|
||||
}else{
|
||||
$(".esr_options").fadeOut("slow");
|
||||
$("#esr_toggle").text("more options");
|
||||
$("#esr_toggle").text("más opciones");
|
||||
$("#esr_toggle_img").attr("src","images/icons/resultset_next.gif");
|
||||
$("#esr_options_expand").val("0");
|
||||
}
|
||||
@ -327,40 +327,40 @@ EOT;
|
||||
<div id="form_manager">
|
||||
<?php show_message(); ?>
|
||||
<div class="info">
|
||||
<h2><a class="breadcrumb" href="manage_form.php?id=<?php echo $form_id; ?>"><?php echo $form_name; ?></a> <img src="images/icons/resultset_next.gif" align="bottom" /> Emails de respuesta</h2>
|
||||
<h2><a class="breadcrumb" href="manage_form.php?id=<?php echo $form_id; ?>"><?php echo $form_name; ?></a> <img src="images/icons/resultset_next.gif" align="bottom" /> Notificaciones de respuesta</h2>
|
||||
<p>Indique a quién se enviará por email las respuestas del formulario</b></p>
|
||||
</div>
|
||||
<h2 style="font-size: 150%;margin-bottom: 10px;">Mandar notificaciones por email <img src="images/icons/arrow_right.gif" align="absmiddle" /></h2>
|
||||
<h2 style="font-size: 150%;margin-bottom: 10px;">Mandar notificaciones por email <img src="images/icons/arrow_right.gif" align="absmiddle" /></h2>
|
||||
<div style="width: 49%;float: left;">
|
||||
<h2 style="font-size: 150%;"><img src="images/icons/edit_user_48.gif" align="absmiddle" />A mi dirección</h2>
|
||||
<div id="es_left">
|
||||
|
||||
<!-- start left form -->
|
||||
<div id="esl_main_body" class="integrated">
|
||||
|
||||
|
||||
<div id="esl_form_container">
|
||||
<form id="esl_form" class="appnitro" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
|
||||
<ul >
|
||||
<li id="esl_li_1" <?php if(!$esl_valid_email){ echo 'class="error"'; } ?>>
|
||||
<label class="description" for="esl_email_address">Mi dirección de email </label>
|
||||
<div>
|
||||
<input id="esl_email_address" name="esl_email_address" class="element text medium" type="text" value="<?php echo $_POST['esl_email_address']; ?>"/>
|
||||
</div>
|
||||
<input id="esl_email_address" name="esl_email_address" class="element text medium" type="text" value="<?php echo $_POST['esl_email_address']; ?>"/>
|
||||
</div>
|
||||
<?php if(!$esl_valid_email){ echo "<p class=\"error\">{$lang['val_email']}</p>"; }; ?>
|
||||
</li>
|
||||
<li id="esl_li_2" class="section_break esl_options">
|
||||
<h3><img src="images/icons/agt_utilities.gif" align="absmiddle" /> Cabecera del email</h3>
|
||||
</li>
|
||||
</li>
|
||||
<li id="esl_li_3" class="esl_options">
|
||||
<label class="description" for="esl_from_name">De (nombre)</label>
|
||||
<div>
|
||||
<input id="esl_from_name" name="esl_from_name" class="element text medium" type="text" value="<?php echo $_POST['esl_from_name']; ?>"/>
|
||||
</div>
|
||||
</li>
|
||||
<input id="esl_from_name" name="esl_from_name" class="element text medium" type="text" value="<?php echo $_POST['esl_from_name']; ?>"/>
|
||||
</div>
|
||||
</li>
|
||||
<li id="esl_li_4" class="esl_options">
|
||||
<label class="description" for="esl_from_email_address">De (email) </label>
|
||||
<div>
|
||||
<select class="element select medium" id="esl_from_email_address" name="esl_from_email_address">
|
||||
<select class="element select medium" id="esl_from_email_address" name="esl_from_email_address">
|
||||
<?php
|
||||
foreach ($esl_email_fields as $data){
|
||||
if($_POST['esl_from_email_address'] == $data['value']){
|
||||
@ -372,24 +372,24 @@ EOT;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
</li>
|
||||
<li id="esl_li_5" class="section_break esl_options">
|
||||
<h3><img src="images/icons/mail_reply_16.gif" align="absmiddle"/> Contenido</h3>
|
||||
</li>
|
||||
</li>
|
||||
<li id="esl_li_6" class="esl_options">
|
||||
<label class="description" for="esl_subject">Asunto </label>
|
||||
<div>
|
||||
<input id="esl_subject" name="esl_subject" class="element text large" type="text" value="<?php echo $_POST['esl_subject']; ?>"/>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<input id="esl_subject" name="esl_subject" class="element text large" type="text" value="<?php echo $_POST['esl_subject']; ?>"/>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<li id="esl_li_7" class="esl_options">
|
||||
<label class="description" for="esl_content">Contenido </label>
|
||||
<div>
|
||||
<textarea id="esl_content" name="esl_content" class="element textarea medium"><?php echo $_POST['esl_content']; ?></textarea>
|
||||
</div>
|
||||
</li>
|
||||
<textarea id="esl_content" name="esl_content" class="element textarea medium"><?php echo $_POST['esl_content']; ?></textarea>
|
||||
</div>
|
||||
</li>
|
||||
<li id="esl_li_8" class="esl_options">
|
||||
<label class="description" for="esl_plain_text"> </label>
|
||||
<span>
|
||||
@ -397,23 +397,23 @@ EOT;
|
||||
<label class="choice" for="esl_plain_text">Enviar el email como texto plano</label>
|
||||
</span>
|
||||
<div style="clear: both;font-size: 95%;padding-top: 10px;margin-bottom: 10px">
|
||||
<img align="absmiddle" src="images/icons/information.gif"/> <b style="color: #444">Info</b><br/> Puede insertar <a href="template_variables.php?id=<?php echo $_REQUEST['id']; ?>" style="color: blue; border-bottom: 1px dotted #000;text-decoration: none">variables de plantilla</a> en los campos anteriores.
|
||||
<img align="absmiddle" src="images/icons/information.gif"/> <b style="color: #444">Info</b><br/> Puede insertar <a href="template_variables.php?id=<?php echo $_REQUEST['id']; ?>" style="color: blue; border-bottom: 1px dotted #000;text-decoration: none">variables de plantilla</a> en los campos anteriores.
|
||||
</div>
|
||||
</li>
|
||||
<li id="esl_li_9" style="background-color: #fff">
|
||||
|
||||
|
||||
<div style="text-align: right">
|
||||
<a href="javascript: toggle_esl_options()" style="color: blue; border-bottom: 1px dotted #000;text-decoration: none" id="esl_toggle"><?php if(!empty($_POST['esl_options_expand'])){ echo 'hide options';} else { echo 'más opciones';} ?></a> <img align="absmiddle" src="images/icons/resultset_next.gif" id="esl_toggle_img"/>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="buttons" style="background-color:#fff; padding-left: 0px; padding-top: 0px;">
|
||||
<input type="hidden" name="id" name="id" value="<?php echo $_REQUEST['id']; ?>"/>
|
||||
<input type="hidden" name="esl_options_expand" id="esl_options_expand" value="<?php echo $_POST['esl_options_expand']; ?>" />
|
||||
<input type="hidden" name="esl_options_expand" id="esl_options_expand" value="<?php echo $_POST['esl_options_expand']; ?>" />
|
||||
<input id="esl_submit" class="button_text" type="submit" name="esl_submit" value="Guardar cambios" />
|
||||
|
||||
</li>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -428,16 +428,16 @@ EOT;
|
||||
|
||||
<!-- start right form -->
|
||||
<div id="esr_main_body" class="integrated">
|
||||
|
||||
|
||||
<div id="esr_form_container">
|
||||
<form id="esr_form" class="appnitro" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
|
||||
<ul >
|
||||
|
||||
|
||||
<li id="esr_li_1" >
|
||||
<label class="description" for="esr_email_address">Coger la dirección email del campo </label>
|
||||
<div>
|
||||
<select class="element select medium" id="esr_email_address" name="esr_email_address" <?php if(empty($esr_email_fields)){ echo 'disabled="disabled"'; } ?>>
|
||||
<option value=""></a>
|
||||
<option value=""></a>
|
||||
<?php
|
||||
foreach ($esr_email_fields as $data){
|
||||
if($_POST['esr_email_address'] == $data['value']){
|
||||
@ -448,48 +448,48 @@ EOT;
|
||||
echo "<option value=\"{$data['value']}\" {$selected}>{$data['label']}</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</select>
|
||||
</div>
|
||||
</li>
|
||||
<?php if(empty($esr_email_fields)){ ?>
|
||||
<li id="esr_li_1" >
|
||||
<label class="description" for="esr_email_address"><img src="images/icons/warning.gif" align="top" /> No se encontrado el campo para el email</label>
|
||||
<div>
|
||||
Para poder enviar un email a sus usarios, debe existir un campo email en el formulario.
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<li class="section_break esr_options">
|
||||
<h3><img src="images/icons/agt_utilities.gif" align="absmiddle" /> Cabecera del email</h3>
|
||||
</li>
|
||||
</li>
|
||||
<li id="esr_li_2" class="esr_options">
|
||||
<label class="description" for="esr_from_name">De (nombre) </label>
|
||||
<div>
|
||||
<input id="esr_from_name" name="esr_from_name" class="element text medium" type="text" value="<?php echo $_POST['esr_from_name']; ?>"/>
|
||||
</div>
|
||||
</li>
|
||||
<input id="esr_from_name" name="esr_from_name" class="element text medium" type="text" value="<?php echo $_POST['esr_from_name']; ?>"/>
|
||||
</div>
|
||||
</li>
|
||||
<li id="esr_li_3" class="esr_options<?php if(!$esr_valid_email){ echo ' error'; } ?>" >
|
||||
<label class="description" for="esr_from_email_address">De (email) </label>
|
||||
<div>
|
||||
<input id="esr_from_email_address" name="esr_from_email_address" class="element text medium" type="text" value="<?php echo $_POST['esr_from_email_address']; ?>"/>
|
||||
</div>
|
||||
<input id="esr_from_email_address" name="esr_from_email_address" class="element text medium" type="text" value="<?php echo $_POST['esr_from_email_address']; ?>"/>
|
||||
</div>
|
||||
<?php if(!$esr_valid_email){ echo "<p class=\"error\">{$lang['val_email']}</p>"; }; ?>
|
||||
</li>
|
||||
<li class="section_break esr_options">
|
||||
<h3><img src="images/icons/mail_forward_16.gif" align="absmiddle"/> Contenido del email</h3>
|
||||
</li>
|
||||
</li>
|
||||
<li id="esr_li_4" class="esr_options">
|
||||
<label class="description" for="esr_subject">Asunto </label>
|
||||
<div>
|
||||
<input id="esr_subject" name="esr_subject" class="element text large" type="text" value="<?php echo $_POST['esr_subject']; ?>"/>
|
||||
</div>
|
||||
</li>
|
||||
<input id="esr_subject" name="esr_subject" class="element text large" type="text" value="<?php echo $_POST['esr_subject']; ?>"/>
|
||||
</div>
|
||||
</li>
|
||||
<li id="esr_li_5" class="esr_options">
|
||||
<label class="description" for="esr_content">Contenido </label>
|
||||
<div>
|
||||
<textarea id="esr_content" name="esr_content" class="element textarea medium"><?php echo $_POST['esr_content']; ?></textarea>
|
||||
</div>
|
||||
</li>
|
||||
<textarea id="esr_content" name="esr_content" class="element textarea medium"><?php echo $_POST['esr_content']; ?></textarea>
|
||||
</div>
|
||||
</li>
|
||||
<li id="esr_li_6" class="esr_options">
|
||||
<label class="description" for="esr_plain_text"> </label>
|
||||
<span>
|
||||
@ -497,23 +497,23 @@ EOT;
|
||||
<label class="choice" for="esr_plain_text">Enviar el email como texto plano</label>
|
||||
</span>
|
||||
<div style="clear: both;font-size: 95%;padding-top: 10px;margin-bottom: 10px">
|
||||
<img align="absmiddle" src="images/icons/information.gif"/> <b style="color: #444">Info</b><br/> Puede insertar <a href="template_variables.php?id=<?php echo $_REQUEST['id']; ?>" style="color: blue; border-bottom: 1px dotted #000;text-decoration: none">variables de plantilla</a> en los campos anteriores.
|
||||
</div>
|
||||
<img align="absmiddle" src="images/icons/information.gif"/> <b style="color: #444">Info</b><br/> Puede insertar <a href="template_variables.php?id=<?php echo $_REQUEST['id']; ?>" style="color: blue; border-bottom: 1px dotted #000;text-decoration: none">variables de plantilla</a> en los campos anteriores.
|
||||
</div>
|
||||
</li>
|
||||
<li id="esr_li_7" style="background-color: #fff">
|
||||
<div style="text-align: right">
|
||||
<?php if(!empty($esr_email_fields)){ ?>
|
||||
<a href="javascript: toggle_esr_options()" style="color: blue; border-bottom: 1px dotted #000;text-decoration: none" id="esr_toggle"><?php if(!empty($_POST['esr_options_expand'])){ echo 'hide options';} else { echo 'más opciones';} ?></a> <img align="absmiddle" src="images/icons/resultset_next.gif" id="esr_toggle_img"/>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="buttons" style="background-color:#fff; padding-left: 0px; padding-top: 0px">
|
||||
<li class="buttons" style="background-color:#fff; padding-left: 0px; padding-top: 0px">
|
||||
<input type="hidden" name="id" name="id" value="<?php echo $_REQUEST['id']; ?>"/>
|
||||
<input type="hidden" name="esr_options_expand" id="esr_options_expand" value="<?php echo $_POST['esr_options_expand']; ?>" />
|
||||
<input type="hidden" name="esr_options_expand" id="esr_options_expand" value="<?php echo $_POST['esr_options_expand']; ?>" />
|
||||
<input id="esr_submit" class="button_text" type="submit" name="esr_submit" value="Guardar cambios" <?php if(empty($esr_email_fields)){ echo 'disabled="disabled"'; } ?>/>
|
||||
</li>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
Before Width: | Height: | Size: 787 B After Width: | Height: | Size: 807 B |
|
Before Width: | Height: | Size: 783 B After Width: | Height: | Size: 751 B |
@ -26,7 +26,7 @@
|
||||
<?php /*<img src="images/appnitro_logo.png" class="fix_png" id="appnitro_logo" width="179" height="55"/>*/ ?>
|
||||
<?php if(empty($hide_nav)){ ?>
|
||||
<ul id="header_tab">
|
||||
<li><a href="manage_form.php" title="Formularios"><img src="images/manage_forms_active.gif" alt=""></a></li>
|
||||
<li><a href="manage_form.php" title="Formularios"><img src="images/manage_forms_active.gif" alt="Formularios"></a></li>
|
||||
<li class="lgo"><a href="logout.php" class="lbOn" title="Salir"><img src="images/logout.gif" alt=""></a></li>
|
||||
</ul>
|
||||
<?php } ?>
|
||||
|
||||
@ -1,21 +1,21 @@
|
||||
<?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/
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
//this function accept 'YYYY-MM-DD HH:MM:SS'
|
||||
function relative_date($input_date) {
|
||||
|
||||
|
||||
$tz = 0; // change this if your web server and weblog are in different timezones
|
||||
|
||||
$posted_date = str_replace(array('-',' ',':'),'',$input_date);
|
||||
|
||||
$posted_date = str_replace(array('-',' ',':'),'',$input_date);
|
||||
$month = substr($posted_date,4,2);
|
||||
|
||||
|
||||
if ($month == "02") { // february
|
||||
// check for leap year
|
||||
$leapYear = isLeapYear(substr($posted_date,0,4));
|
||||
@ -24,14 +24,14 @@
|
||||
}
|
||||
else { // not february
|
||||
// check to see if the month has 30/31 days in it
|
||||
if ($month == "04" or
|
||||
$month == "06" or
|
||||
$month == "09" or
|
||||
if ($month == "04" or
|
||||
$month == "06" or
|
||||
$month == "09" or
|
||||
$month == "11")
|
||||
$month_in_seconds = 2592000; // 30 day month
|
||||
else $month_in_seconds = 2678400; // 31 day month;
|
||||
}
|
||||
|
||||
|
||||
$in_seconds = strtotime(substr($posted_date,0,8).' '.
|
||||
substr($posted_date,8,2).':'.
|
||||
substr($posted_date,10,2).':'.
|
||||
@ -48,7 +48,7 @@
|
||||
$minutes = floor($diff/60);
|
||||
$diff -= $minutes*60;
|
||||
$seconds = $diff;
|
||||
|
||||
|
||||
$relative_date = '';
|
||||
if ($months>0) {
|
||||
// over a month old, just show date ("Month, Day Year")
|
||||
@ -77,22 +77,22 @@
|
||||
// seconds only
|
||||
$relative_date .= ($relative_date?', ':'').$seconds.' second'.($seconds>1?'s':'');
|
||||
}
|
||||
|
||||
|
||||
// show relative date and add proper verbiage
|
||||
return $relative_date.' ago';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//this function accept 'YYYY-MM-DD HH:MM:SS'
|
||||
function short_relative_date($input_date) {
|
||||
|
||||
|
||||
$tz = 0; // change this if your web server and weblog are in different timezones
|
||||
|
||||
$posted_date = str_replace(array('-',' ',':'),'',$input_date);
|
||||
|
||||
$posted_date = str_replace(array('-',' ',':'),'',$input_date);
|
||||
$month = substr($posted_date,4,2);
|
||||
$year = substr($posted_date,0,4);
|
||||
|
||||
|
||||
if ($month == "02") { // february
|
||||
// check for leap year
|
||||
$leapYear = isLeapYear($year);
|
||||
@ -101,14 +101,14 @@
|
||||
}
|
||||
else { // not february
|
||||
// check to see if the month has 30/31 days in it
|
||||
if ($month == "04" or
|
||||
$month == "06" or
|
||||
$month == "09" or
|
||||
if ($month == "04" or
|
||||
$month == "06" or
|
||||
$month == "09" or
|
||||
$month == "11")
|
||||
$month_in_seconds = 2592000; // 30 day month
|
||||
else $month_in_seconds = 2678400; // 31 day month;
|
||||
}
|
||||
|
||||
|
||||
$in_seconds = strtotime(substr($posted_date,0,8).' '.
|
||||
substr($posted_date,8,2).':'.
|
||||
substr($posted_date,10,2).':'.
|
||||
@ -125,10 +125,10 @@
|
||||
$minutes = floor($diff/60);
|
||||
$diff -= $minutes*60;
|
||||
$seconds = $diff;
|
||||
|
||||
|
||||
$relative_date = '';
|
||||
if ($months>0) {
|
||||
|
||||
|
||||
// over a month old
|
||||
if(!empty($input_date)){
|
||||
if($year < date('Y')){ //over a year, show international date
|
||||
@ -136,7 +136,7 @@
|
||||
}else{ //less than a year
|
||||
return date('M j',strtotime($input_date));
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
return '';
|
||||
}
|
||||
@ -160,17 +160,17 @@
|
||||
// seconds only
|
||||
$relative_date .= ($relative_date?', ':'').$seconds.' second'.($seconds>1?'s':'');
|
||||
}
|
||||
|
||||
|
||||
// show relative date and add proper verbiage
|
||||
return $relative_date.' ago';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function isLeapYear($year) {
|
||||
return $year % 4 == 0 && ($year % 400 == 0 || $year % 100 != 0);
|
||||
}
|
||||
|
||||
|
||||
//remove a folder and all it's content
|
||||
function full_rmdir($dirname){
|
||||
if ($dirHandle = opendir($dirname)){
|
||||
@ -199,80 +199,80 @@
|
||||
|
||||
//show success or error messages
|
||||
function show_message(){
|
||||
|
||||
|
||||
if(!empty($_SESSION['AP_ERROR'])){
|
||||
if(!empty($_SESSION['AP_ERROR']['desc'])){
|
||||
$error_desc = '<p id="error_message_desc"><b>'.$_SESSION['AP_ERROR']['desc'].'</b></p>';
|
||||
}else{
|
||||
$error_desc = '';
|
||||
}
|
||||
|
||||
|
||||
$ul_markup =<<<EOT
|
||||
<ul class="global_message">
|
||||
<li id="error_message">
|
||||
<h3 id="error_message_title">{$_SESSION['AP_ERROR']['title']} <img src="images/icons/stop.gif" align="top" style="padding-top: 2px"/></h3>
|
||||
{$error_desc}
|
||||
</li>
|
||||
</li>
|
||||
</ul>
|
||||
EOT;
|
||||
|
||||
echo $ul_markup;
|
||||
|
||||
|
||||
$_SESSION['AP_ERROR'] = array();
|
||||
unset($_SESSION['AP_ERROR']);
|
||||
}
|
||||
|
||||
|
||||
if(!empty($_SESSION['AP_SUCCESS'])){
|
||||
if(!empty($_SESSION['AP_SUCCESS']['desc'])){
|
||||
$success_desc = '<p id="success_message_desc"><b>'.$_SESSION['AP_SUCCESS']['desc'].'</b></p>';
|
||||
}else{
|
||||
$success_desc = '';
|
||||
}
|
||||
|
||||
|
||||
$ul_markup =<<<EOT
|
||||
<ul class="global_message">
|
||||
<li id="success_message">
|
||||
<h3 id="success_message_title"><span>{$_SESSION['AP_SUCCESS']['title']} <img src="images/icons/checkbox.gif" align="absmiddle" /></span></h3>
|
||||
{$success_desc}
|
||||
</li>
|
||||
</li>
|
||||
</ul>
|
||||
EOT;
|
||||
|
||||
echo $ul_markup;
|
||||
|
||||
|
||||
$_SESSION['AP_SUCCESS'] = array();
|
||||
unset($_SESSION['AP_SUCCESS']);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//send notification email
|
||||
//$to_emails is a comma separated list of email address or {element_x} field
|
||||
function send_notification($form_id,$entry_id,$to_emails,$email_param){
|
||||
|
||||
|
||||
$from_name = $email_param['from_name'];
|
||||
$from_email = $email_param['from_email'];
|
||||
$subject = $email_param['subject'];
|
||||
$content = nl2br($email_param['content']);
|
||||
$as_plain_text = $email_param['as_plain_text']; //if set to 'true' the email content will be a simple plain text
|
||||
$target_is_admin = $email_param['target_is_admin']; //if set to 'false', the download link for uploaded file will be removed
|
||||
|
||||
|
||||
|
||||
|
||||
//get data for the particular entry id
|
||||
if($target_is_admin === false){
|
||||
$options['strip_download_link'] = true;
|
||||
}
|
||||
|
||||
|
||||
$options['strip_checkbox_image'] = true;
|
||||
$options['machform_base_path'] = $email_param['machform_base_path']; //the path to machform
|
||||
$entry_details = get_entry_details($form_id,$entry_id,$options);
|
||||
|
||||
|
||||
//populate field values to template variables
|
||||
$i=0;
|
||||
foreach ($entry_details as $data){
|
||||
$template_variables[$i] = '{element_'.$data['element_id'].'}';
|
||||
$template_values[$i] = $data['value'];
|
||||
|
||||
|
||||
if($data['element_type'] == 'textarea'){
|
||||
$template_values[$i] = nl2br($data['value']);
|
||||
}elseif ($data['element_type'] == 'file'){
|
||||
@ -284,25 +284,25 @@ EOT;
|
||||
}else{
|
||||
$template_values[$i] = $data['value'];
|
||||
}
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
//get entry timestamp
|
||||
$query = "select date_created,ip_address from `ap_form_{$form_id}` where id='$entry_id'";
|
||||
$result = do_query($query);
|
||||
$row = do_fetch_result($result);
|
||||
|
||||
|
||||
$date_created = $row['date_created'];
|
||||
$ip_address = $row['ip_address'];
|
||||
|
||||
|
||||
//get form name
|
||||
$query = "select form_name from `ap_forms` where form_id='$form_id'";
|
||||
$result = do_query($query);
|
||||
$row = do_fetch_result($result);
|
||||
$form_name = $row['form_name'];
|
||||
|
||||
|
||||
|
||||
|
||||
$template_variables[$i] = '{date_created}';
|
||||
$template_values[$i] = $date_created;
|
||||
$i++;
|
||||
@ -317,58 +317,58 @@ EOT;
|
||||
$i++;
|
||||
$template_variables[$i] = '{form_id}';
|
||||
$template_values[$i] = $form_id;
|
||||
|
||||
|
||||
|
||||
|
||||
//compose {entry_data} based on 'as_plain_text' preferences
|
||||
$email_body = '';
|
||||
if(!$as_plain_text){
|
||||
//compose html format
|
||||
$email_body = '<table width="100%" border="0" cellspacing="0" cellpadding="0" style="font-family:Lucida Grande,Tahoma,Arial,Verdana,sans-serif;font-size:12px;text-align:left">'."\n";
|
||||
|
||||
|
||||
$toggle = false;
|
||||
foreach ($entry_details as $data){
|
||||
//0 should be displayed, empty string don't
|
||||
if((empty($data['value']) || $data['value'] == ' ') && $data['value'] !== 0 && $data['value'] !== '0'){
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($toggle){
|
||||
$toggle = false;
|
||||
$row_style = 'style="background-color:#F3F7FB"';
|
||||
}else{
|
||||
$toggle = true;
|
||||
$row_style = '';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($data['element_type'] == 'textarea'){
|
||||
$data['value'] = nl2br($data['value']);
|
||||
}elseif ($data['element_type'] == 'file'){
|
||||
|
||||
|
||||
if($target_is_admin === false){
|
||||
$data['value'] = strip_tags($data['value']);
|
||||
}else{
|
||||
$data['value'] = strip_tags($data['value'],'<a>');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$email_body .= "<tr {$row_style}>\n";
|
||||
$email_body .= '<td width="40%" style="border-bottom:1px solid #DEDEDE;padding:5px 10px;"><strong>'.$data['label'].'</strong> </td>'."\n";
|
||||
$email_body .= '<td width="60%" style="border-bottom:1px solid #DEDEDE;padding:5px 10px;">'.$data['value'].'</td>'."\n";
|
||||
$email_body .= '</tr>'."\n";
|
||||
|
||||
$email_body .= '</tr>'."\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
$email_body .= "</table>\n";
|
||||
}else{
|
||||
|
||||
|
||||
//compose text format
|
||||
foreach ($entry_details as $data){
|
||||
|
||||
|
||||
//0 should be displayed, empty string don't
|
||||
if((empty($data['value']) || $data['value'] == ' ') && $data['value'] !== 0 && $data['value'] !== '0'){
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if($data['element_type'] == 'textarea'){
|
||||
$email_body .= "<b>{$data['label']}</b> <br />".nl2br($data['value'])."<br /><br />\n";
|
||||
}elseif ($data['element_type'] == 'checkbox' || $data['element_type'] == 'address'){
|
||||
@ -384,38 +384,38 @@ EOT;
|
||||
}else{
|
||||
$email_body .= "<b>{$data['label']}</b> - {$data['value']} <br />\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$i = count($template_variables);
|
||||
$template_variables[$i] = '{entry_data}';
|
||||
$template_values[$i] = $email_body;
|
||||
|
||||
|
||||
$mail = new PHPMailer();
|
||||
$mail->CharSet = 'UTF-8';
|
||||
$mail->Host = "127.0.0.1";
|
||||
$mail->IsHTML(true);
|
||||
$mail->Mailer = "mail";
|
||||
$mail->Mailer = "mail";
|
||||
$mail->SMTPAuth = false;
|
||||
|
||||
|
||||
if(USE_SMTP === true){
|
||||
$mail->Mailer = "smtp";
|
||||
$mail->Host = SMTP_HOST;
|
||||
$mail->Port = SMTP_PORT;
|
||||
|
||||
|
||||
if(SMTP_AUTH === true){
|
||||
$mail->SMTPAuth = true;
|
||||
$mail->SMTPAuth = true;
|
||||
$mail->Username = SMTP_USERNAME;
|
||||
$mail->Password = SMTP_PASSWORD;
|
||||
}
|
||||
|
||||
|
||||
if(SMTP_SECURE === true){
|
||||
$mail->SMTPSecure = 'tls';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//parse from_name template
|
||||
if(!empty($from_name)){
|
||||
$from_name = str_replace($template_variables,$template_values,$from_name);
|
||||
@ -423,12 +423,12 @@ EOT;
|
||||
}elseif (NOTIFICATION_MAIL_FROM_NAME != ''){
|
||||
$mail->FromName = utf8_encode(str_replace(' ','',str_replace($template_variables,$template_values,NOTIFICATION_MAIL_FROM_NAME)));
|
||||
}else{
|
||||
$mail->FromName = 'MachForm';
|
||||
$mail->FromName = '';
|
||||
}
|
||||
|
||||
|
||||
//decode any html entity
|
||||
$mail->FromName = html_entity_decode($mail->FromName,ENT_QUOTES);
|
||||
|
||||
|
||||
//parse from_email_address template
|
||||
if(!empty($from_email)){
|
||||
$from_email = str_replace($template_variables,$template_values,$from_email);
|
||||
@ -439,7 +439,7 @@ EOT;
|
||||
$domain = str_replace('www.','',$_SERVER['SERVER_NAME']);
|
||||
$mail->From = "no-reply@{$domain}";
|
||||
}
|
||||
|
||||
|
||||
//parse subject template
|
||||
if(!empty($subject)){
|
||||
$subject = str_replace($template_variables,$template_values,$subject);
|
||||
@ -455,24 +455,24 @@ EOT;
|
||||
}
|
||||
//decode any html entity
|
||||
$mail->Subject = html_entity_decode($mail->Subject,ENT_QUOTES);
|
||||
|
||||
|
||||
|
||||
|
||||
//parse content template
|
||||
$email_content = str_replace($template_variables,$template_values,$content);
|
||||
|
||||
|
||||
//add footer
|
||||
$email_content .= "<br /><br /><br /><br /><br /><b style=\"font-family:Lucida Grande,Tahoma,Arial,Verdana,sans-serif;font-size:12px\">Powered by <a href=\"http://www.appnitro.com\">MachForm</a></b>";
|
||||
|
||||
$email_content .= "<br /><br /><br /><br /><br /><b style=\"font-family:Lucida Grande,Tahoma,Arial,Verdana,sans-serif;font-size:12px\"></b>";
|
||||
|
||||
//enclose with container div
|
||||
$email_content = '<div style="font-family:Lucida Grande,Tahoma,Arial,Verdana,sans-serif;font-size:12px">'.$email_content.'</div>';
|
||||
|
||||
|
||||
$mail->Body = $email_content;
|
||||
|
||||
|
||||
//send email
|
||||
$to_emails = str_replace(' ','',str_replace($template_variables,$template_values,$to_emails));
|
||||
$email_address = explode(',',$to_emails);
|
||||
|
||||
$has_email = false;
|
||||
|
||||
$has_email = false;
|
||||
foreach ($email_address as $email){
|
||||
$email = trim($email);
|
||||
if(!empty($email)){
|
||||
@ -480,35 +480,35 @@ EOT;
|
||||
$has_email = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($has_email){
|
||||
$send_status = $mail->Send();
|
||||
$mail->ClearAddresses();
|
||||
|
||||
|
||||
if($send_status !== true){
|
||||
echo "Error sending email: ".$mail->ErrorInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function get_ssl_suffix(){
|
||||
if(!empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] != 'off')){
|
||||
$ssl_suffix = 's';
|
||||
}else{
|
||||
$ssl_suffix = '';
|
||||
}
|
||||
|
||||
|
||||
return $ssl_suffix;
|
||||
}
|
||||
|
||||
|
||||
function get_dirname($path){
|
||||
$current_dir = dirname($path);
|
||||
|
||||
|
||||
if($current_dir == "/" || $current_dir == "\\"){
|
||||
$current_dir = '';
|
||||
}
|
||||
|
||||
|
||||
return $current_dir;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@ -1,96 +1,97 @@
|
||||
<?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/
|
||||
******************************************************************************/
|
||||
global $lang;
|
||||
|
||||
|
||||
//simple name and extended name
|
||||
$lang['name_first'] = 'Primero';
|
||||
$lang['name_last'] = 'Último';
|
||||
$lang['name_title'] = 'Título';
|
||||
$lang['name_first'] = 'Nombre';
|
||||
$lang['name_last'] = 'Apellidos';
|
||||
$lang['name_title'] = 'Título';
|
||||
$lang['name_suffix'] = 'Sufijo';
|
||||
|
||||
|
||||
//address
|
||||
$lang['address_street'] = 'Dirección';
|
||||
$lang['address_street2'] = 'Dirección (cont)';
|
||||
$lang['address_city'] = 'Población';
|
||||
$lang['address_street'] = 'Dirección';
|
||||
$lang['address_street2'] = 'Dirección (cont)';
|
||||
$lang['address_city'] = 'Población';
|
||||
$lang['address_state'] = 'Provincia';
|
||||
$lang['address_zip'] = 'Código postal';
|
||||
$lang['address_country'] = 'País';
|
||||
$lang['address_zip'] = 'Código postal';
|
||||
$lang['address_country'] = 'País';
|
||||
|
||||
//captcha
|
||||
$lang['captcha_required'] = 'Este campo es obligatorio. Por favor, introduzca las letras que aparecen en la imagen.';
|
||||
$lang['captcha_mismatch'] = 'No coinciden las letras introducidas con las que aparecen en la imagen. Por favor, inténtelo otra vez.';
|
||||
$lang['captcha_error'] = 'Se ha producido un error en el proceso. Por favor, inténtelo otra vez.';
|
||||
$lang['captcha_mismatch'] = 'No coinciden las letras introducidas con las que aparecen en la imagen. Por favor, inténtelo otra vez.';
|
||||
$lang['captcha_error'] = 'Se ha producido un error en el proceso. Por favor, inténtelo otra vez.';
|
||||
$lang['captcha_title'] = 'Introduzca las letras que aparecen en la imagen de abajo.';
|
||||
|
||||
|
||||
//date
|
||||
$lang['date_dd'] = 'DD';
|
||||
$lang['date_mm'] = 'MM';
|
||||
$lang['date_yyyy'] = 'YYYY';
|
||||
|
||||
$lang['date_yyyy'] = 'AAAA';
|
||||
|
||||
//price
|
||||
$lang['price_dollar_main'] = 'Dólares';
|
||||
$lang['price_dollar_main'] = 'Dólares';
|
||||
$lang['price_dollar_sub'] = 'Centavos';
|
||||
$lang['price_euro_main'] = 'Euros';
|
||||
$lang['price_euro_sub'] = 'Céntimos';
|
||||
$lang['price_euro_sub'] = 'Céntimos';
|
||||
$lang['price_pound_main'] = 'Libras';
|
||||
$lang['price_pound_sub'] = 'Peniques';
|
||||
$lang['price_yen'] = 'Yenes';
|
||||
|
||||
|
||||
//time
|
||||
$lang['time_hh'] = 'HH';
|
||||
$lang['time_mm'] = 'MM';
|
||||
$lang['time_ss'] = 'SS';
|
||||
|
||||
|
||||
//error message
|
||||
$lang['error_title'] = 'Se ha producido un error en su envio.';
|
||||
$lang['error_desc'] = 'Los errores están <strong>resaltados</strong> abajo.';
|
||||
|
||||
$lang['error_desc'] = 'Los errores están <strong>resaltados</strong> 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';
|
||||
?>
|
||||
2595
includes/mobile-view-functions.php
Normal file
2541
includes/standard-view-functions.php
Normal file
56
index.php
@ -1,46 +1,46 @@
|
||||
<?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/
|
||||
******************************************************************************/
|
||||
session_start();
|
||||
session_start();
|
||||
|
||||
require('config.php');
|
||||
require('includes/db-core.php');
|
||||
require('includes/db-functions.php');
|
||||
require('includes/helper-functions.php');
|
||||
|
||||
|
||||
$ssl_suffix = get_ssl_suffix();
|
||||
|
||||
|
||||
if(file_exists("installer.php")){
|
||||
header("Location: http{$ssl_suffix}://".$_SERVER['HTTP_HOST'].get_dirname($_SERVER['PHP_SELF'])."/installer.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
//redirect to form manager if already logged-in
|
||||
if(!empty($_SESSION['logged_in']) && $_SESSION['logged_in'] == true){
|
||||
header("Location: http{$ssl_suffix}://".$_SERVER['HTTP_HOST'].get_dirname($_SERVER['PHP_SELF'])."/manage_form.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
if(!empty($_POST['submit'])){
|
||||
$username = trim($_POST['admin_username']);
|
||||
$password = trim($_POST['admin_password']);
|
||||
if(($username != ADMIN_USER) || ($password != ADMIN_PASSWORD)){
|
||||
$_SESSION['AP_LOGIN_ERROR'] = 'Please enter the correct user and password!';
|
||||
$_SESSION['AP_LOGIN_ERROR'] = 'Por favor, introduzca su usuario y su contraseña correctamente';
|
||||
}else{
|
||||
$_SESSION['logged_in'] = true;
|
||||
|
||||
|
||||
if(!empty($_SESSION['prev_referer'])){
|
||||
$next_page = $_SESSION['prev_referer'];
|
||||
|
||||
|
||||
unset($_SESSION['prev_referer']);
|
||||
header("Location: http{$ssl_suffix}://".$_SERVER['HTTP_HOST'].$next_page);
|
||||
|
||||
|
||||
exit;
|
||||
}else{
|
||||
header("Location: http{$ssl_suffix}://".$_SERVER['HTTP_HOST'].get_dirname($_SERVER['PHP_SELF'])."/manage_form.php");
|
||||
@ -48,13 +48,13 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(!empty($_GET['from'])){
|
||||
$_SESSION['prev_referer'] = base64_decode($_GET['from']);
|
||||
}
|
||||
|
||||
|
||||
$hide_nav = true;
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<?php require('includes/header.php'); ?>
|
||||
@ -69,35 +69,35 @@
|
||||
<div id="form_container" style="align: center">
|
||||
<form id="form_login" class="appnitro" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
|
||||
<ul style="width: 40%;">
|
||||
<?php if(!empty($_SESSION['AP_LOGIN_ERROR'])){ ?>
|
||||
<?php if(!empty($_SESSION['AP_LOGIN_ERROR'])){ ?>
|
||||
<li class="error" style="padding-top:20px;padding-bottom:20px;text-align: center">
|
||||
<label class="desc">
|
||||
<label class="desc">
|
||||
<?php echo $_SESSION['AP_LOGIN_ERROR']; ?>
|
||||
</label>
|
||||
</li>
|
||||
<?php
|
||||
unset($_SESSION['AP_LOGIN_ERROR']);
|
||||
}
|
||||
?>
|
||||
</li>
|
||||
<?php
|
||||
unset($_SESSION['AP_LOGIN_ERROR']);
|
||||
}
|
||||
?>
|
||||
<li class="highlighted" style="padding-left: 30px;padding-top: 30px;padding-right: 30px">
|
||||
|
||||
|
||||
<label class="desc" for="admin_username"><img src="images/icons/edit_user.gif" align="absmiddle" style="padding-bottom: 5px"/> Usuario</label>
|
||||
<div>
|
||||
<input id="admin_username" name="admin_username" class="element text large" type="text" maxlength="255" value=""/>
|
||||
<input id="admin_username" name="admin_username" class="element text large" type="text" maxlength="255" value=""/>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</li>
|
||||
<li class="highlighted" style="padding-left: 30px;padding-bottom: 30px;padding-right: 30px">
|
||||
<label class="desc" for="admin_password"><img src="images/icons/decrypted.gif" align="absmiddle" style="padding-bottom: 5px"/> Contraseña </label>
|
||||
<div>
|
||||
<input id="admin_password" name="admin_password" class="element text large" type="password" maxlength="255" value=""/>
|
||||
</div>
|
||||
<input id="admin_password" name="admin_password" class="element text large" type="password" maxlength="255" value=""/>
|
||||
</div>
|
||||
</li>
|
||||
<li class="buttons" style="padding-left:0px">
|
||||
<input id="login" class="button_text" type="submit" name="submit" value="Entrar" style="padding: 8px" />
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
</form>
|
||||
</div><br />
|
||||
|
||||
</div>
|
||||
|
||||
@ -166,6 +166,7 @@
|
||||
}
|
||||
});
|
||||
if (d === true) {
|
||||
|
||||
this.find("*").andSelf().each(function (i) {
|
||||
var a = v.data(this, "events");
|
||||
for (var b in a) {
|
||||
@ -902,6 +903,7 @@
|
||||
button: '"button"==a.type||jQuery.nodeName(a,"button")',
|
||||
input: "/input|select|textarea|button/i.test(a.nodeName)",
|
||||
has: "jQuery.find(m[3],a).length",
|
||||
|
||||
header: "/h\\d/i.test(a.nodeName)",
|
||||
animated: "jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length"
|
||||
}
|
||||
@ -1241,6 +1243,7 @@
|
||||
} else {
|
||||
if (d[b]) {
|
||||
if (c) {
|
||||
|
||||
delete d[b][c.guid]
|
||||
} else {
|
||||
for (c in d[b]) {
|
||||
@ -1624,6 +1627,7 @@
|
||||
lastModified: {},
|
||||
ajax: function (s) {
|
||||
var c, jsre = /=(\?|%3F)/g,
|
||||
|
||||
status, data;
|
||||
s = v.extend(true, s, v.extend(true, {},
|
||||
v.ajaxSettings, s));
|
||||
@ -2369,6 +2373,7 @@ var JJ = jQuery.noConflict();
|
||||
S = 0,
|
||||
Y = this[0],
|
||||
M = this[0],
|
||||
|
||||
L,
|
||||
I,
|
||||
W = G.css(Y, "position"),
|
||||
@ -3102,16 +3107,16 @@ field.prototype = {
|
||||
return A
|
||||
},
|
||||
name: function () {
|
||||
return '<div><span><input readonly="readonly" class="text" size="2" type="text"><label>Title</label></span><span><input readonly="readonly" class="text" size="12" type="text"><label>First</label></span><span><input readonly="readonly" class="text" size="14" type="text"><label>Last</label></span><span><input readonly="readonly" class="text" size="3" type="text"><label>Suffix</label></span></div>'
|
||||
return '<div><span><input readonly="readonly" class="text" size="2" type="text"><label>Título</label></span><span><input readonly="readonly" class="text" size="12" type="text"><label>Nombre</label></span><span><input readonly="readonly" class="text" size="14" type="text"><label>Apellidos</label></span><span><input readonly="readonly" class="text" size="3" type="text"><label>Sufijo</label></span></div>'
|
||||
},
|
||||
simple_name: function () {
|
||||
return '<div><span><input readonly="readonly" class="text" size="12" type="text"><label>First</label></span><span><input readonly="readonly" class="text" size="14" type="text"><label>Last</label></span></div>'
|
||||
return '<div><span><input readonly="readonly" class="text" size="12" type="text"><label>Nombre</label></span><span><input readonly="readonly" class="text" size="14" type="text"><label>Apellidos</label></span></div>'
|
||||
},
|
||||
date: function () {
|
||||
return '<div><span><input readonly="readonly" class="text" size="2" type="text"> / <label>MM</label></span><span><input readonly="readonly" class="text" size="2" type="text"> / <label>DD</label></span><span><input readonly="readonly" class="text" size="4" type="text"> <label>YYYY</label></span><img src="images/icons/calendar.gif" alt="Elegir una fecha" class="icon"></div>'
|
||||
return '<div><span><input readonly="readonly" class="text" size="2" type="text"> / <label>MM</label></span><span><input readonly="readonly" class="text" size="2" type="text"> / <label>DD</label></span><span><input readonly="readonly" class="text" size="4" type="text"> <label>AAAA</label></span><img src="images/icons/calendar.gif" alt="Elegir una fecha" class="icon"></div>'
|
||||
},
|
||||
europe_date: function () {
|
||||
return '<div><span><input readonly="readonly" class="text" size="2" type="text"> / <label>DD</label></span><span><input readonly="readonly" class="text" size="2" type="text"> / <label>MM</label></span><span><input readonly="readonly" class="text" size="4" type="text"> <label>YYYY</label></span><img src="images/icons/calendar.gif" alt="Elegir una fecha" class="icon"></div>'
|
||||
return '<div><span><input readonly="readonly" class="text" size="2" type="text"> / <label>DD</label></span><span><input readonly="readonly" class="text" size="2" type="text"> / <label>MM</label></span><span><input readonly="readonly" class="text" size="4" type="text"> <label>AAAA</label></span><img src="images/icons/calendar.gif" alt="Elegir una fecha" class="icon"></div>'
|
||||
},
|
||||
time: function () {
|
||||
if (ds.get(this.id, "constraint") == "show_seconds") {
|
||||
@ -3197,10 +3202,10 @@ data_source.prototype = {
|
||||
title = "Lista desplegable";
|
||||
break;
|
||||
case "radio":
|
||||
title = "Selección múltiple";
|
||||
title = "Botón de opciones";
|
||||
break;
|
||||
case "checkbox":
|
||||
title = "Cajas de selección";
|
||||
title = "Casillas de selección";
|
||||
break;
|
||||
case "name":
|
||||
title = "Nombre";
|
||||
@ -3240,6 +3245,7 @@ data_source.prototype = {
|
||||
break;
|
||||
case "file":
|
||||
title = "Carga de fichero";
|
||||
|
||||
break;
|
||||
case "section":
|
||||
title = "Salto de sección";
|
||||
@ -3260,19 +3266,31 @@ data_source.prototype = {
|
||||
default_value: "",
|
||||
constraint: "",
|
||||
options: [{
|
||||
option: "Primera opción",
|
||||
option: "Primera",
|
||||
is_default: 0,
|
||||
is_db_live: "0",
|
||||
id: "0"
|
||||
},
|
||||
{
|
||||
option: "Segunda opción",
|
||||
option: "Segunda",
|
||||
is_default: 0,
|
||||
is_db_live: "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_db_live: "0",
|
||||
id: "0"
|
||||
@ -3646,7 +3664,7 @@ function delete_checkbox(c, d, e, f) {
|
||||
return false
|
||||
}
|
||||
if (e == "checkbox" && d == 1) {
|
||||
confirmed = confirm("All data associated with this choice will be deleted. Are you sure you want to delete this choice?")
|
||||
confirmed = confirm("¿Desea eliminar este campo?")
|
||||
} else {
|
||||
confirmed = true
|
||||
}
|
||||
@ -3755,7 +3773,7 @@ function switch_display(A, B) {
|
||||
}
|
||||
function delete_element(A) {
|
||||
if (ds.get(A, "is_db_live") == "1") {
|
||||
confirmed = confirm("All data associated with this field will be deleted. Are you sure you want to delete this field?")
|
||||
confirmed = confirm("¿Desea eliminar este campo?")
|
||||
} else {
|
||||
confirmed = true
|
||||
}
|
||||
@ -3766,7 +3784,7 @@ function delete_element(A) {
|
||||
}
|
||||
function delete_from_db(c) {
|
||||
if (ds.get(c, "is_db_live") == "1") {
|
||||
JJ("#statusText").html("Deleting ... Please wait ...");
|
||||
JJ("#statusText").html("Eliminando, por favor, espere...");
|
||||
JJ.post("delete_element.php", {
|
||||
form_id: json_form.id,
|
||||
element_id: c
|
||||
@ -3776,7 +3794,7 @@ function delete_from_db(c) {
|
||||
if (b.status == "ok") {
|
||||
delete_element_markup(c)
|
||||
} else {
|
||||
alert("An error occured while deleting your field!")
|
||||
alert("Ha ocurrido un error mientras se eliminaba el campo")
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
||||
372
manage_form.php
@ -1,14 +1,14 @@
|
||||
<?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/
|
||||
******************************************************************************/
|
||||
session_start();
|
||||
|
||||
|
||||
require('config.php');
|
||||
require('includes/check-session.php');
|
||||
require('includes/db-core.php');
|
||||
@ -16,21 +16,21 @@
|
||||
require('includes/helper-functions.php');
|
||||
|
||||
connect_db();
|
||||
|
||||
|
||||
$rows_per_page = 10;
|
||||
|
||||
|
||||
//check for id parameter, if exist, populate the pageno automatically
|
||||
if(!empty($_GET['id'])){
|
||||
$form_id = (int) trim($_GET['id']);
|
||||
|
||||
|
||||
$query = "select form_id from `ap_forms` order by form_id asc";
|
||||
$result = do_query($query);
|
||||
|
||||
|
||||
while($row = do_fetch_result($result)){
|
||||
$form_id_lookup[] = (int) $row['form_id'];
|
||||
}
|
||||
$form_id_chunks = array_chunk($form_id_lookup,$rows_per_page);
|
||||
|
||||
|
||||
foreach ($form_id_chunks as $key=>$value){
|
||||
$index_key = array_search($form_id,$value,true);
|
||||
if($index_key !== false){
|
||||
@ -39,29 +39,29 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//check for form delete parameter
|
||||
if(!empty($_GET['delete'])){
|
||||
$deleted_form_id = (int) trim($_GET['delete']);
|
||||
delete_form($deleted_form_id);
|
||||
}
|
||||
|
||||
|
||||
//check for form duplicate parameter
|
||||
if(!empty($_GET['duplicate'])){
|
||||
$target_form_id = (int) trim($_GET['duplicate']);
|
||||
$result_form_id = duplicate_form($target_form_id);
|
||||
|
||||
|
||||
if(!empty($result_form_id)){
|
||||
$_SESSION['AP_SUCCESS']['title'] = 'Completado';
|
||||
$_SESSION['AP_SUCCESS']['desc'] = 'Formulario duplicado.';
|
||||
|
||||
|
||||
header("Location: manage_form.php?id={$result_form_id}");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/****Pagination *************/
|
||||
//get page number for pagination
|
||||
if(!empty($pageno_auto)){
|
||||
@ -71,36 +71,36 @@
|
||||
}else{
|
||||
$pageno = 1;
|
||||
}
|
||||
|
||||
|
||||
//identify how many database rows are available
|
||||
$query = "select count(*) total_row from `ap_forms`";
|
||||
$result = do_query($query);
|
||||
$row = do_fetch_result($result);
|
||||
|
||||
|
||||
$numrows = $row['total_row'];
|
||||
|
||||
|
||||
$lastpage = ceil($numrows/$rows_per_page);
|
||||
|
||||
|
||||
|
||||
|
||||
//ensure that $pageno is within range
|
||||
//this code checks that the value of $pageno is an integer between 1 and $lastpage
|
||||
$pageno = (int)$pageno;
|
||||
|
||||
if ($pageno < 1) {
|
||||
|
||||
if ($pageno < 1) {
|
||||
$pageno = 1;
|
||||
}
|
||||
elseif ($pageno > $lastpage){
|
||||
$pageno = $lastpage;
|
||||
}
|
||||
|
||||
|
||||
//construct the LIMIT clause for the sql SELECT statement
|
||||
if(!empty($numrows)){
|
||||
$limit = 'LIMIT ' .($pageno - 1) * $rows_per_page .',' .$rows_per_page;
|
||||
}
|
||||
/*****End Pagination code *******/
|
||||
|
||||
|
||||
|
||||
/*****End Pagination code *******/
|
||||
|
||||
|
||||
|
||||
//get form list
|
||||
$query = "select form_id,form_name,form_active,form_email from `ap_forms` order by form_id asc $limit";
|
||||
$result = do_query($query);
|
||||
@ -109,16 +109,16 @@
|
||||
while($row = do_fetch_result($result)){
|
||||
$form_list[$i]['form_id'] = $row['form_id'];
|
||||
$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'])){
|
||||
$form_list[$i]['form_email'] = $row['form_email'];
|
||||
$form_list[$i]['form_email'] = $row['form_email'];
|
||||
}else{
|
||||
$form_list[$i]['form_email'] = 'nadie';
|
||||
$form_list[$i]['form_email'] = 'nadie';
|
||||
}
|
||||
$form_id_array[] = $row['form_id'];
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
//get total entries for each form
|
||||
foreach ($form_id_array as $form_id){
|
||||
//get all time entries
|
||||
@ -126,20 +126,20 @@
|
||||
$result = do_query($query);
|
||||
$row = do_fetch_result($result);
|
||||
$entries[$form_id]['total'] = $row['total_entry'];
|
||||
|
||||
|
||||
//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') ";
|
||||
$result = do_query($query);
|
||||
$row = do_fetch_result($result);
|
||||
$entries[$form_id]['today'] = $row['today_entry'];
|
||||
|
||||
|
||||
//get latest entry timing
|
||||
$query = "select date_created from `ap_form_{$form_id}` order by id desc limit 1";
|
||||
$result = do_query($query);
|
||||
$row = do_fetch_result($result);
|
||||
$entries[$form_id]['latest_entry'] = relative_date($row['date_created']);
|
||||
}
|
||||
|
||||
|
||||
$header_data =<<<EOT
|
||||
<script type="text/javascript" src="js/base.js"></script>
|
||||
<script type="text/javascript" src="js/rico.js"></script>
|
||||
@ -158,98 +158,98 @@
|
||||
}
|
||||
</style>
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
|
||||
function disable_form(form_id){
|
||||
var progress_image = $('progress_image_' + form_id);
|
||||
progress_image.style.visibility = "visible";
|
||||
|
||||
$('activation_link_' + form_id).innerHTML = 'Procesando...';
|
||||
$('activation_link_' + form_id).href = '#';
|
||||
|
||||
|
||||
var url = 'ajax_form_activation.php';
|
||||
var pars = 'form_id=' + form_id + '&operation=disable';
|
||||
|
||||
|
||||
var myAjax = new Ajax.Request( url, { method: 'post', parameters: pars, onComplete: showResponseDisabled });
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function showResponseDisabled(originalRequest){
|
||||
var response = originalRequest.responseText;
|
||||
|
||||
|
||||
$('form_status_' + response).innerHTML = 'Desactivado';
|
||||
$('image_status_' + response).src = 'images/icons/disabled.gif';
|
||||
$('activation_link_' + response).innerHTML = 'Activar este formulario';
|
||||
$('activation_link_' + response).href = 'javascript: enable_form(' + response + ')';
|
||||
|
||||
|
||||
var progress_image = $('progress_image_' + response);
|
||||
progress_image.style.visibility = "hidden";
|
||||
|
||||
new Effect.Highlight('form_status_' + response,{duration:1});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function enable_form(form_id){
|
||||
var progress_image = $('progress_image_' + form_id);
|
||||
progress_image.style.visibility = "visible";
|
||||
|
||||
|
||||
$('activation_link_' + form_id).innerHTML = 'Procesando...';
|
||||
$('activation_link_' + form_id).href = '#';
|
||||
|
||||
|
||||
var url = 'ajax_form_activation.php';
|
||||
var pars = 'form_id=' + form_id + '&operation=enable';
|
||||
|
||||
|
||||
var myAjax = new Ajax.Request( url, { method: 'post', parameters: pars, onComplete: showResponseEnabled });
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function showResponseEnabled(originalRequest){
|
||||
var response = originalRequest.responseText;
|
||||
|
||||
|
||||
$('form_status_' + response).innerHTML = 'Activado';
|
||||
$('image_status_' + response).src = 'images/icons/checkbox.gif';
|
||||
$('activation_link_' + response).innerHTML = 'Desactivar este formulario';
|
||||
$('activation_link_' + response).href = 'javascript: disable_form(' + response + ')';
|
||||
|
||||
|
||||
var progress_image = $('progress_image_' + response);
|
||||
progress_image.style.visibility = "hidden";
|
||||
|
||||
new Effect.Highlight('form_status_' + response,{duration:1});
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
new Effect.Highlight('form_status_' + response,{duration:1});
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
EOT;
|
||||
|
||||
//delete a form, definition, entries and uploaded files
|
||||
function delete_form($form_id){
|
||||
//remove from ap_forms
|
||||
//remove from ap_forms
|
||||
$query = "delete from `ap_forms` where form_id='$form_id'";
|
||||
do_query($query);
|
||||
|
||||
|
||||
//remove from ap_form_elements
|
||||
$query = "delete from `ap_form_elements` where form_id='$form_id'";
|
||||
do_query($query);
|
||||
|
||||
|
||||
//remove from ap_element_options
|
||||
$query = "delete from `ap_element_options` where form_id='$form_id'";
|
||||
do_query($query);
|
||||
|
||||
|
||||
//remove from ap_column_preferences
|
||||
$query = "delete from `ap_column_preferences` where form_id='$form_id'";
|
||||
do_query($query);
|
||||
|
||||
|
||||
//remove review table
|
||||
$query = "drop table if exists `ap_form_{$form_id}_review`";
|
||||
do_query($query);
|
||||
|
||||
|
||||
//remove the actual table
|
||||
$query = "drop table if exists `ap_form_{$form_id}`";
|
||||
do_query($query);
|
||||
|
||||
//remove form folder
|
||||
|
||||
//remove form folder
|
||||
@full_rmdir(UPLOAD_DIR."/form_{$form_id}");
|
||||
if(DATA_DIR != UPLOAD_DIR){
|
||||
@full_rmdir(DATA_DIR."/form_{$form_id}");
|
||||
@ -259,7 +259,7 @@ EOT;
|
||||
|
||||
//duplicate a form
|
||||
function duplicate_form($form_id){
|
||||
|
||||
|
||||
//set the new name
|
||||
$query = "select form_name,form_review from `ap_forms` where form_id='$form_id'";
|
||||
$result = do_query($query);
|
||||
@ -267,137 +267,137 @@ EOT;
|
||||
$form_review = $row['form_review'];
|
||||
$form_name = trim($row['form_name']);
|
||||
$form_name .= " Copy";
|
||||
|
||||
|
||||
//get new form_id
|
||||
$query = "select max(form_id)+1 new_form_id from `ap_forms`";
|
||||
$result = do_query($query);
|
||||
$row = do_fetch_result($result);
|
||||
$new_form_id = trim($row['new_form_id']);
|
||||
|
||||
|
||||
//insert into ap_forms table
|
||||
$query = "select * from `ap_forms` where form_id='{$form_id}'";
|
||||
$result = do_query($query);
|
||||
|
||||
|
||||
$i = 0;
|
||||
$columns = array();
|
||||
$fields_num = mysql_num_fields($result);
|
||||
while($i < $fields_num){
|
||||
$meta = mysql_fetch_field($result, $i);
|
||||
|
||||
|
||||
if(($meta->name != 'form_id') && ($meta->name != 'form_name')){
|
||||
$columns[] = $meta->name;
|
||||
}
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//build the query string
|
||||
$columns_joined = implode(",",$columns);
|
||||
$form_name = mysql_real_escape_string($form_name);
|
||||
|
||||
$form_name = mysql_real_escape_string($form_name);
|
||||
|
||||
//insert to ap_forms
|
||||
$query = "insert into
|
||||
`ap_forms`(form_id,form_name,{$columns_joined})
|
||||
select
|
||||
{$new_form_id},'{$form_name}',{$columns_joined}
|
||||
from
|
||||
`ap_forms`
|
||||
where
|
||||
$query = "insert into
|
||||
`ap_forms`(form_id,form_name,{$columns_joined})
|
||||
select
|
||||
{$new_form_id},'{$form_name}',{$columns_joined}
|
||||
from
|
||||
`ap_forms`
|
||||
where
|
||||
form_id='$form_id'";
|
||||
do_query($query);
|
||||
|
||||
|
||||
//create the new table
|
||||
do_query("create table `ap_form_{$new_form_id}` like `ap_form_{$form_id}`");
|
||||
|
||||
|
||||
|
||||
|
||||
//copy ap_form_elements table
|
||||
$query = "select * from `ap_form_elements` limit 1";
|
||||
$result = do_query($query);
|
||||
|
||||
|
||||
$i = 0;
|
||||
$columns = array();
|
||||
$fields_num = mysql_num_fields($result);
|
||||
while($i < $fields_num){
|
||||
$meta = mysql_fetch_field($result, $i);
|
||||
|
||||
|
||||
if($meta->name != 'form_id'){
|
||||
$columns[] = $meta->name;
|
||||
}
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
$columns_joined = implode("`,`",$columns);
|
||||
$query = "insert into
|
||||
`ap_form_elements`(form_id,`{$columns_joined}`)
|
||||
select
|
||||
{$new_form_id},`{$columns_joined}`
|
||||
from
|
||||
`ap_form_elements`
|
||||
where
|
||||
$query = "insert into
|
||||
`ap_form_elements`(form_id,`{$columns_joined}`)
|
||||
select
|
||||
{$new_form_id},`{$columns_joined}`
|
||||
from
|
||||
`ap_form_elements`
|
||||
where
|
||||
form_id='$form_id'";
|
||||
do_query($query);
|
||||
|
||||
|
||||
//copy ap_element_options table
|
||||
$query = "select * from `ap_element_options` limit 1";
|
||||
$result = do_query($query);
|
||||
|
||||
|
||||
$i = 0;
|
||||
$columns = array();
|
||||
$fields_num = mysql_num_fields($result);
|
||||
while($i < $fields_num){
|
||||
$meta = mysql_fetch_field($result, $i);
|
||||
|
||||
|
||||
if(($meta->name != 'form_id') && ($meta->name != 'aeo_id')){
|
||||
$columns[] = $meta->name;
|
||||
}
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
$columns_joined = implode("`,`",$columns);
|
||||
$query = "insert into
|
||||
`ap_element_options`(form_id,`{$columns_joined}`)
|
||||
select
|
||||
{$new_form_id},`{$columns_joined}`
|
||||
from
|
||||
`ap_element_options`
|
||||
where
|
||||
$query = "insert into
|
||||
`ap_element_options`(form_id,`{$columns_joined}`)
|
||||
select
|
||||
{$new_form_id},`{$columns_joined}`
|
||||
from
|
||||
`ap_element_options`
|
||||
where
|
||||
form_id='$form_id'";
|
||||
do_query($query);
|
||||
|
||||
|
||||
|
||||
|
||||
//copy ap_column_preferences table
|
||||
$query = "select * from `ap_column_preferences` limit 1";
|
||||
$result = do_query($query);
|
||||
|
||||
|
||||
$i = 0;
|
||||
$columns = array();
|
||||
$fields_num = mysql_num_fields($result);
|
||||
while($i < $fields_num){
|
||||
$meta = mysql_fetch_field($result, $i);
|
||||
|
||||
|
||||
if(($meta->name != 'form_id') && ($meta->name != 'acp_id')){
|
||||
$columns[] = $meta->name;
|
||||
}
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
$columns_joined = implode("`,`",$columns);
|
||||
$query = "insert into
|
||||
`ap_column_preferences`(form_id,`{$columns_joined}`)
|
||||
select
|
||||
{$new_form_id},`{$columns_joined}`
|
||||
from
|
||||
`ap_column_preferences`
|
||||
where
|
||||
$query = "insert into
|
||||
`ap_column_preferences`(form_id,`{$columns_joined}`)
|
||||
select
|
||||
{$new_form_id},`{$columns_joined}`
|
||||
from
|
||||
`ap_column_preferences`
|
||||
where
|
||||
form_id='$form_id'";
|
||||
do_query($query);
|
||||
|
||||
|
||||
//copy ap_form_xx_review table if exists
|
||||
if(!empty($form_review)){
|
||||
do_query("CREATE TABLE `ap_form_{$new_form_id}_review` like `ap_form_{$form_id}_review`");
|
||||
}
|
||||
|
||||
|
||||
//create form folder
|
||||
$old_mask = umask(0);
|
||||
mkdir(DATA_DIR."/form_{$new_form_id}",0777);
|
||||
@ -407,13 +407,13 @@ EOT;
|
||||
}
|
||||
mkdir(UPLOAD_DIR."/form_{$new_form_id}/files",0777);
|
||||
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");
|
||||
|
||||
|
||||
return $new_form_id;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<?php require('includes/header.php'); ?>
|
||||
@ -431,29 +431,29 @@ EOT;
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
<?php
|
||||
$i=($pageno -1) * $rows_per_page + 1;
|
||||
$first_row_number = $i;
|
||||
if(!empty($form_list)){
|
||||
|
||||
echo '<div id="accordionDiv">';
|
||||
|
||||
foreach ($form_list as $data){
|
||||
|
||||
if(!empty($data['form_active'])){
|
||||
$form_status = 'Activado';
|
||||
echo '<div id="accordionDiv">';
|
||||
|
||||
foreach ($form_list as $data){
|
||||
|
||||
if(!empty($data['form_active'])){
|
||||
$form_status = 'Activado';
|
||||
$image_status = 'checkbox.gif';
|
||||
$activation_text = 'Desactivar este formulario';
|
||||
$activation_link = 'disable_form';
|
||||
}else{
|
||||
$form_status = 'Desactivado';
|
||||
}else{
|
||||
$form_status = 'Desactivado';
|
||||
$image_status = 'disabled.gif';
|
||||
$activation_text = 'Activar este formulario';
|
||||
$activation_link = 'enable_form';
|
||||
};
|
||||
|
||||
|
||||
?>
|
||||
};
|
||||
|
||||
|
||||
?>
|
||||
<div id="overviewPanel">
|
||||
<div id="overviewHeader" class="accordionTabTitle">
|
||||
<h3><?php echo "$i. {$data['form_name']}" ?></h3>
|
||||
@ -465,10 +465,10 @@ 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_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>
|
||||
<?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%"> </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="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%"><a href="send_form.php?id=<?php echo $data['form_id']; ?>"><img src="images/icons/mail_forward_32.gif" /></a></td>-->
|
||||
<td width="12%"><a href="view.php?id=<?php echo base64_encode($data['form_id']); ?>" target="_blank"><img src="images/icons/view_form_32.gif" /></a></td>
|
||||
<td width="18%"> </td>
|
||||
<td width="9%"><a href="<?php echo "manage_form.php?duplicate={$data['form_id']}"; ?>"><img src="images/icons/copy_32.gif" /></a></td>
|
||||
<td width="6%"><a href="manage_form.php?pageno=<?php echo $pageno; ?>&delete=<?php echo $data['form_id']; ?>" onclick="javascript: return confirm('¿Desea eliminar este formulario y todas las respuestas asociadas?');"><img src="images/icons/cross.gif" /></a></td>
|
||||
</tr>
|
||||
@ -476,55 +476,55 @@ EOT;
|
||||
<td ><a href="<?php echo "manage_entries.php?id={$data['form_id']}"; ?>">Respuestas</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 "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> </td>
|
||||
<td><a href="view.php?id=<?php echo $data['form_id']; ?>" target="_blank">Ver formulario</a></td>
|
||||
<td nowrap><a href="<?php echo "email_settings.php?id={$data['form_id']}"; ?>">Notificaciones</a></td>
|
||||
<td nowrap><a href="<?php echo "embed_code.php?id={$data['form_id']}"; ?>">Código</a></td>
|
||||
<!--<td nowrap><a href="<?php echo "send_form.php?id={$data['form_id']}"; ?>">Enviar el formulario</a></td>-->
|
||||
<td><a href="view.php?id=<?php echo base64_encode($data['form_id']); ?>" target="_blank">Ver formulario</a></td>
|
||||
<td> </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>
|
||||
</tr>
|
||||
</table>
|
||||
</table>
|
||||
<div style="clear:both; padding-left: 10px; padding-top: 10px">
|
||||
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>
|
||||
Ú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">
|
||||
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>
|
||||
|
||||
|
||||
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>
|
||||
<img id="progress_image_<?php echo $data['form_id']; ?>" align="absmiddle" src="images/loader-red.gif" style="visibility: hidden"/>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
<?php
|
||||
$i++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$last_row_number = --$i;
|
||||
|
||||
|
||||
if(!empty($active_tab_auto)){
|
||||
$active_tab = $active_tab_auto;
|
||||
}else{
|
||||
$active_tab = 0;
|
||||
}
|
||||
|
||||
|
||||
echo '</div>';
|
||||
echo '<script type="text/javascript">';
|
||||
echo 'new Rico.Accordion( $(\'accordionDiv\'), {panelHeight:200,expandedBg: \'#4B75B3\',collapsedBg: \'#4B75B3\',hoverBg: \'#3661A1\', onLoadShowTab: '.$active_tab.'} );';
|
||||
echo '</script>';
|
||||
echo '</script>';
|
||||
|
||||
}else{
|
||||
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 -->
|
||||
<div id="paging" >
|
||||
<br>
|
||||
<?php
|
||||
<?php
|
||||
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> ";
|
||||
}
|
||||
$prevpage = $pageno-1;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//middle navigation
|
||||
if($pageno == 1){
|
||||
$i=1;
|
||||
@ -564,7 +564,7 @@ EOT;
|
||||
echo ' ... ';
|
||||
}
|
||||
}elseif ($pageno == $lastpage){
|
||||
|
||||
|
||||
if(($lastpage - 19) > 1){
|
||||
echo ' ... ';
|
||||
$i=1;
|
||||
@ -591,18 +591,18 @@ EOT;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
$next_pages = false;
|
||||
$prev_pages = false;
|
||||
|
||||
|
||||
if(($lastpage - ($pageno + 9)) >= 1){
|
||||
$next_pages = true;
|
||||
}
|
||||
if(($pageno - 9) > 1){
|
||||
$prev_pages = true;
|
||||
}
|
||||
|
||||
|
||||
if($prev_pages){ //if there are previous pages
|
||||
echo ' ... ';
|
||||
if($next_pages){ //if there are next pages
|
||||
@ -620,7 +620,7 @@ EOT;
|
||||
}
|
||||
echo ' ... ';
|
||||
}else{
|
||||
|
||||
|
||||
$i=1;
|
||||
$j=$pageno - 9;
|
||||
while(($i<=19) && ($j <= $lastpage)){
|
||||
@ -633,9 +633,9 @@ EOT;
|
||||
$i++;
|
||||
$j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{ //if there aren't previous pages
|
||||
|
||||
|
||||
$i=1;
|
||||
while(($i<=19) && ($i <= $lastpage)){
|
||||
if($i != $pageno){
|
||||
@ -645,26 +645,26 @@ EOT;
|
||||
}
|
||||
echo " <a href='{$_SERVER['PHP_SELF']}?pageno=$i' $active_style>$i</a> ";
|
||||
$i++;
|
||||
|
||||
|
||||
}
|
||||
if($next_pages){
|
||||
echo ' ... ';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if ($pageno != $lastpage)
|
||||
|
||||
if ($pageno != $lastpage)
|
||||
{
|
||||
$nextpage = $pageno+1;
|
||||
if($lastpage > 19){
|
||||
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
|
||||
?>
|
||||
<div class="footer">
|
||||
|
||||
1138
mobile/apple/css/developer-style.css
Normal file
81
mobile/apple/css/forms.css
Normal file
@ -0,0 +1,81 @@
|
||||
.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;
|
||||
}
|
||||
|
||||
|
||||
.datefield {
|
||||
color:blue;
|
||||
float:right;
|
||||
position:relative;
|
||||
top:12px;
|
||||
right:10px;
|
||||
}
|
||||
92
mobile/apple/css/spinningwheel.css
Normal file
@ -0,0 +1,92 @@
|
||||
#sw-wrapper {
|
||||
position:absolute; z-index:1000;
|
||||
left:0;
|
||||
width:100%;
|
||||
font-family:helvetica, sans-serif;
|
||||
background:rgba(0,0,0,0.7);
|
||||
text-align:left;
|
||||
}
|
||||
|
||||
#sw-header {
|
||||
position:relative;
|
||||
width:100%; height:43px;
|
||||
border-top:1px solid #000; border-bottom:1px solid #000;
|
||||
background:url(../images/sw-header.png) 0 0 repeat-x;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
#sw-cancel, #sw-done {
|
||||
position:absolute;
|
||||
top:7px;
|
||||
height:20px; line-height:20px;
|
||||
padding:0 5px; margin:0;
|
||||
border-width:5px;
|
||||
font-size:12px; font-weight:bold;
|
||||
text-shadow:rgba(0,0,0,0.8) 0 -1px 0;
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
#sw-cancel {
|
||||
left:7px;
|
||||
float:left;
|
||||
-webkit-border-image:url(../images/sw-button-cancel.png) 5;
|
||||
}
|
||||
|
||||
#sw-done {
|
||||
right:7px;
|
||||
float:right;
|
||||
-webkit-border-image:url(../images/sw-button-done.png) 5;
|
||||
}
|
||||
|
||||
.sw-pressed { opacity:0.4; }
|
||||
|
||||
#sw-slots-wrapper {
|
||||
position:relative; z-index:999;
|
||||
display:block;
|
||||
height:215px;
|
||||
padding:0 11px;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
#sw-slots {
|
||||
display:table;
|
||||
width:100%;
|
||||
background:#fcfcfc;
|
||||
}
|
||||
|
||||
#sw-slots div {
|
||||
display:table-cell;
|
||||
height:100%;
|
||||
padding-top:86px;
|
||||
border-left:2px solid #0d0e0f;
|
||||
background-color:#fcfcfc;
|
||||
background-image: url(../images/sw-slot-border.png);
|
||||
background-position: 0 0, 100% 0;
|
||||
background-repeat: repeat-y;
|
||||
}
|
||||
|
||||
#sw-slots div:first-child { border:0; }
|
||||
|
||||
#sw-slots ul {
|
||||
padding:0 0 85px 0; margin:0;
|
||||
list-style:none;
|
||||
}
|
||||
|
||||
#sw-slots .sw-right { text-align:right; }
|
||||
#sw-slots .sw-shrink { width:1%; }
|
||||
#sw-slots .sw-readonly { background:#ddd; }
|
||||
|
||||
#sw-slots li {
|
||||
padding:0 8px;
|
||||
height:44px;
|
||||
overflow:hidden;
|
||||
font:bold 24px/44px Helvetica,sans-serif;
|
||||
}
|
||||
|
||||
#sw-frame {
|
||||
position:absolute; z-index:1000;
|
||||
left:0; right:0; bottom:0;
|
||||
height:183px;
|
||||
border-width:16px;
|
||||
-webkit-border-image:url(../images/sw-alpha.png) 16;
|
||||
}
|
||||
1
mobile/apple/css/style.css
Normal file
BIN
mobile/apple/images/0stars.png
Normal file
|
After Width: | Height: | Size: 314 B |
BIN
mobile/apple/images/0starsborder.png
Normal file
|
After Width: | Height: | Size: 363 B |
BIN
mobile/apple/images/1stars.png
Normal file
|
After Width: | Height: | Size: 456 B |
BIN
mobile/apple/images/1starsborder.png
Normal file
|
After Width: | Height: | Size: 482 B |
BIN
mobile/apple/images/2stars.png
Normal file
|
After Width: | Height: | Size: 467 B |
BIN
mobile/apple/images/2starsborder.png
Normal file
|
After Width: | Height: | Size: 501 B |
BIN
mobile/apple/images/3stars.png
Normal file
|
After Width: | Height: | Size: 470 B |
BIN
mobile/apple/images/3starsborder.png
Normal file
|
After Width: | Height: | Size: 506 B |
BIN
mobile/apple/images/4stars.png
Normal file
|
After Width: | Height: | Size: 455 B |
BIN
mobile/apple/images/4starsborder.png
Normal file
|
After Width: | Height: | Size: 503 B |
BIN
mobile/apple/images/5stars.png
Normal file
|
After Width: | Height: | Size: 393 B |
BIN
mobile/apple/images/arrow.png
Normal file
|
After Width: | Height: | Size: 361 B |
BIN
mobile/apple/images/checkbox.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
mobile/apple/images/home.png
Normal file
|
After Width: | Height: | Size: 361 B |
BIN
mobile/apple/images/navbutton.png
Normal file
|
After Width: | Height: | Size: 571 B |
BIN
mobile/apple/images/navbuttonblack.png
Normal file
|
After Width: | Height: | Size: 493 B |
BIN
mobile/apple/images/navbuttonblue.png
Normal file
|
After Width: | Height: | Size: 664 B |
BIN
mobile/apple/images/navleft.png
Normal file
|
After Width: | Height: | Size: 826 B |
BIN
mobile/apple/images/navleftblack.png
Normal file
|
After Width: | Height: | Size: 810 B |
BIN
mobile/apple/images/navlinkleft.png
Normal file
|
After Width: | Height: | Size: 786 B |
BIN
mobile/apple/images/navlinkleftblack.png
Normal file
|
After Width: | Height: | Size: 737 B |
BIN
mobile/apple/images/navlinkright.png
Normal file
|
After Width: | Height: | Size: 804 B |
BIN
mobile/apple/images/navlinkrightblack.png
Normal file
|
After Width: | Height: | Size: 738 B |
BIN
mobile/apple/images/navright.png
Normal file
|
After Width: | Height: | Size: 845 B |
BIN
mobile/apple/images/navrightblack.png
Normal file
|
After Width: | Height: | Size: 861 B |
BIN
mobile/apple/images/play.gif
Normal file
|
After Width: | Height: | Size: 103 B |
BIN
mobile/apple/images/radiobutton.png
Normal file
|
After Width: | Height: | Size: 373 B |
BIN
mobile/apple/images/searchfield.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
mobile/apple/images/sw-alpha.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
mobile/apple/images/sw-button-cancel.png
Normal file
|
After Width: | Height: | Size: 538 B |
BIN
mobile/apple/images/sw-button-done.png
Normal file
|
After Width: | Height: | Size: 767 B |
BIN
mobile/apple/images/sw-header.png
Normal file
|
After Width: | Height: | Size: 682 B |
BIN
mobile/apple/images/sw-slot-border.png
Normal file
|
After Width: | Height: | Size: 126 B |
BIN
mobile/apple/images/tributton.png
Normal file
|
After Width: | Height: | Size: 476 B |
77
mobile/apple/javascript/calendar.js
Normal file
@ -0,0 +1,77 @@
|
||||
function openTimePicker(elem1,elem2,elem3,elem4,elem5) {
|
||||
var now = new Time();
|
||||
var hours = { };
|
||||
var minutes = { };
|
||||
var seconds = { };
|
||||
|
||||
for( var i = 0; i < 24; i += 1 ) {
|
||||
hours[i] = i;
|
||||
}
|
||||
|
||||
for( i = 0; i < 60; i += 1 ) {
|
||||
minutes[i] = i;
|
||||
seconds[i] = i;
|
||||
}
|
||||
|
||||
alert('jur');
|
||||
|
||||
SpinningWheel.addSlot(hours, 'right', now.getHours());
|
||||
SpinningWheel.addSlot(minutes, 'right', now.getMinutes());
|
||||
SpinningWheel.addSlot(seconds, 'right', now.getSeconds());
|
||||
|
||||
SpinningWheel.setCancelAction(function(){
|
||||
//document.getElementById(elem1).innerHTML = "cancelled";
|
||||
});
|
||||
|
||||
SpinningWheel.setDoneAction(function(){
|
||||
var results = SpinningWheel.getSelectedValues();
|
||||
|
||||
var ap = "AM";
|
||||
if (results.keys[0] > 11) { ap = "PM"; }
|
||||
if (results.keys[0] > 12) { results.keys[0] = results.keys[0] - 12; }
|
||||
if (results.keys[0] == 0) { results.keys[0] = 12; }
|
||||
|
||||
document.getElementById(elem1).innerHTML = results.values.join(' ');
|
||||
document.getElementById(elem2).value = results.keys.join(' ');
|
||||
document.getElementById(elem3).value = results.keys[0];
|
||||
document.getElementById(elem4).value = results.keys[1];
|
||||
document.getElementById(elem5).value = results.keys[2];
|
||||
document.getElementById(elem6).value = ap;
|
||||
});
|
||||
|
||||
SpinningWheel.open();
|
||||
}
|
||||
|
||||
function openCalendar(elem1,elem2,elem3,elem4,elem5) {
|
||||
var now = new Date();
|
||||
var days = { };
|
||||
var years = { };
|
||||
var months = { 1: 'Ene', 2: 'Feb', 3: 'Mar', 4: 'Abr', 5: 'May', 6: 'Jun', 7: 'Jul', 8: 'Ago', 9: 'Sep', 10: 'Oct', 11: 'Nov', 12: 'Dic' };
|
||||
|
||||
for( var i = 1; i < 32; i += 1 ) {
|
||||
days[i] = i;
|
||||
}
|
||||
|
||||
for( i = now.getFullYear()-10; i < now.getFullYear()+10; i += 1 ) {
|
||||
years[i] = i;
|
||||
}
|
||||
|
||||
SpinningWheel.addSlot(days, 'right', now.getDate());
|
||||
SpinningWheel.addSlot(months, '', now.getMonth());
|
||||
SpinningWheel.addSlot(years, 'right', now.getFullYear());
|
||||
|
||||
SpinningWheel.setCancelAction(function(){
|
||||
//document.getElementById(elem1).innerHTML = "cancelled";
|
||||
});
|
||||
SpinningWheel.setDoneAction(function(){
|
||||
var results = SpinningWheel.getSelectedValues();
|
||||
document.getElementById(elem1).innerHTML = results.values.join(' ');
|
||||
document.getElementById(elem2).value = results.keys.join(' ');
|
||||
document.getElementById(elem3).value = results.keys[0];
|
||||
document.getElementById(elem4).value = results.keys[1];
|
||||
document.getElementById(elem5).value = results.keys[2];
|
||||
});
|
||||
|
||||
SpinningWheel.open();
|
||||
}
|
||||
|
||||
29
mobile/apple/javascript/developer-functions.js
Normal file
@ -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();
|
||||
};
|
||||
}
|
||||
1
mobile/apple/javascript/functions.js
Normal file
@ -0,0 +1 @@
|
||||
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()}}
|
||||
492
mobile/apple/javascript/spinningwheel.js
Normal file
@ -0,0 +1,492 @@
|
||||
/**
|
||||
*
|
||||
* Find more about the Spinning Wheel function at
|
||||
* http://cubiq.org/spinning-wheel-on-webkit-for-iphone-ipod-touch/11
|
||||
*
|
||||
* Copyright (c) 2009 Matteo Spinelli, http://cubiq.org/
|
||||
* Released under MIT license
|
||||
* http://cubiq.org/dropbox/mit-license.txt
|
||||
*
|
||||
* Version 1.4 - Last updated: 2009.07.09
|
||||
*
|
||||
*/
|
||||
|
||||
var SpinningWheel = {
|
||||
cellHeight: 44,
|
||||
friction: 0.003,
|
||||
slotData: [],
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Event handler
|
||||
*
|
||||
*/
|
||||
|
||||
handleEvent: function (e) {
|
||||
if (e.type == 'touchstart') {
|
||||
this.lockScreen(e);
|
||||
if (e.currentTarget.id == 'sw-cancel' || e.currentTarget.id == 'sw-done') {
|
||||
this.tapDown(e);
|
||||
} else if (e.currentTarget.id == 'sw-frame') {
|
||||
this.scrollStart(e);
|
||||
}
|
||||
} else if (e.type == 'touchmove') {
|
||||
this.lockScreen(e);
|
||||
|
||||
if (e.currentTarget.id == 'sw-cancel' || e.currentTarget.id == 'sw-done') {
|
||||
this.tapCancel(e);
|
||||
} else if (e.currentTarget.id == 'sw-frame') {
|
||||
this.scrollMove(e);
|
||||
}
|
||||
} else if (e.type == 'touchend') {
|
||||
if (e.currentTarget.id == 'sw-cancel' || e.currentTarget.id == 'sw-done') {
|
||||
this.tapUp(e);
|
||||
} else if (e.currentTarget.id == 'sw-frame') {
|
||||
this.scrollEnd(e);
|
||||
}
|
||||
} else if (e.type == 'webkitTransitionEnd') {
|
||||
if (e.target.id == 'sw-wrapper') {
|
||||
this.destroy();
|
||||
} else {
|
||||
this.backWithinBoundaries(e);
|
||||
}
|
||||
} else if (e.type == 'orientationchange') {
|
||||
this.onOrientationChange(e);
|
||||
} else if (e.type == 'scroll') {
|
||||
this.onScroll(e);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Global events
|
||||
*
|
||||
*/
|
||||
|
||||
onOrientationChange: function (e) {
|
||||
window.scrollTo(0, 0);
|
||||
this.swWrapper.style.top = window.innerHeight + window.pageYOffset + 'px';
|
||||
this.calculateSlotsWidth();
|
||||
},
|
||||
|
||||
onScroll: function (e) {
|
||||
this.swWrapper.style.top = window.innerHeight + window.pageYOffset + 'px';
|
||||
},
|
||||
|
||||
lockScreen: function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Initialization
|
||||
*
|
||||
*/
|
||||
|
||||
reset: function () {
|
||||
this.slotEl = [];
|
||||
|
||||
this.activeSlot = null;
|
||||
|
||||
this.swWrapper = undefined;
|
||||
this.swSlotWrapper = undefined;
|
||||
this.swSlots = undefined;
|
||||
this.swFrame = undefined;
|
||||
},
|
||||
|
||||
calculateSlotsWidth: function () {
|
||||
var div = this.swSlots.getElementsByTagName('div');
|
||||
for (var i = 0; i < div.length; i += 1) {
|
||||
this.slotEl[i].slotWidth = div[i].offsetWidth;
|
||||
}
|
||||
},
|
||||
|
||||
create: function () {
|
||||
var i, l, out, ul, div;
|
||||
|
||||
this.reset(); // Initialize object variables
|
||||
|
||||
// Create the Spinning Wheel main wrapper
|
||||
div = document.createElement('div');
|
||||
div.id = 'sw-wrapper';
|
||||
div.style.top = window.innerHeight + window.pageYOffset + 'px'; // Place the SW down the actual viewing screen
|
||||
div.style.webkitTransitionProperty = '-webkit-transform';
|
||||
div.innerHTML = '<div id="sw-header"><div id="sw-cancel">Cancelar</' + 'div><div id="sw-done">Guardar</' + 'div></' + 'div><div id="sw-slots-wrapper"><div id="sw-slots"></' + 'div></' + 'div><div id="sw-frame"></' + 'div>';
|
||||
|
||||
document.body.appendChild(div);
|
||||
|
||||
this.swWrapper = div; // The SW wrapper
|
||||
this.swSlotWrapper = document.getElementById('sw-slots-wrapper'); // Slots visible area
|
||||
this.swSlots = document.getElementById('sw-slots'); // Pseudo table element (inner wrapper)
|
||||
this.swFrame = document.getElementById('sw-frame'); // The scrolling controller
|
||||
|
||||
// Create HTML slot elements
|
||||
for (l = 0; l < this.slotData.length; l += 1) {
|
||||
// Create the slot
|
||||
ul = document.createElement('ul');
|
||||
out = '';
|
||||
for (i in this.slotData[l].values) {
|
||||
out += '<li>' + this.slotData[l].values[i] + '<' + '/li>';
|
||||
}
|
||||
ul.innerHTML = out;
|
||||
|
||||
div = document.createElement('div'); // Create slot container
|
||||
div.className = this.slotData[l].style; // Add styles to the container
|
||||
div.appendChild(ul);
|
||||
|
||||
// Append the slot to the wrapper
|
||||
this.swSlots.appendChild(div);
|
||||
|
||||
ul.slotPosition = l; // Save the slot position inside the wrapper
|
||||
ul.slotYPosition = 0;
|
||||
ul.slotWidth = 0;
|
||||
ul.slotMaxScroll = this.swSlotWrapper.clientHeight - ul.clientHeight - 86;
|
||||
ul.style.webkitTransitionTimingFunction = 'cubic-bezier(0, 0, 0.2, 1)'; // Add default transition
|
||||
|
||||
this.slotEl.push(ul); // Save the slot for later use
|
||||
|
||||
// Place the slot to its default position (if other than 0)
|
||||
if (this.slotData[l].defaultValue) {
|
||||
this.scrollToValue(l, this.slotData[l].defaultValue);
|
||||
}
|
||||
}
|
||||
|
||||
this.calculateSlotsWidth();
|
||||
|
||||
// Global events
|
||||
document.addEventListener('touchstart', this, false); // Prevent page scrolling
|
||||
document.addEventListener('touchmove', this, false); // Prevent page scrolling
|
||||
window.addEventListener('orientationchange', this, true); // Optimize SW on orientation change
|
||||
window.addEventListener('scroll', this, true); // Reposition SW on page scroll
|
||||
|
||||
// Cancel/Done buttons events
|
||||
document.getElementById('sw-cancel').addEventListener('touchstart', this, false);
|
||||
document.getElementById('sw-done').addEventListener('touchstart', this, false);
|
||||
|
||||
// Add scrolling to the slots
|
||||
this.swFrame.addEventListener('touchstart', this, false);
|
||||
},
|
||||
|
||||
open: function () {
|
||||
this.create();
|
||||
|
||||
this.swWrapper.style.webkitTransitionTimingFunction = 'ease-out';
|
||||
this.swWrapper.style.webkitTransitionDuration = '400ms';
|
||||
this.swWrapper.style.webkitTransform = 'translate3d(0, -260px, 0)';
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Unload
|
||||
*
|
||||
*/
|
||||
|
||||
destroy: function () {
|
||||
this.swWrapper.removeEventListener('webkitTransitionEnd', this, false);
|
||||
|
||||
this.swFrame.removeEventListener('touchstart', this, false);
|
||||
|
||||
document.getElementById('sw-cancel').removeEventListener('touchstart', this, false);
|
||||
document.getElementById('sw-done').removeEventListener('touchstart', this, false);
|
||||
|
||||
document.removeEventListener('touchstart', this, false);
|
||||
document.removeEventListener('touchmove', this, false);
|
||||
window.removeEventListener('orientationchange', this, true);
|
||||
window.removeEventListener('scroll', this, true);
|
||||
|
||||
this.slotData = [];
|
||||
this.cancelAction = function () {
|
||||
return false;
|
||||
};
|
||||
|
||||
this.cancelDone = function () {
|
||||
return true;
|
||||
};
|
||||
|
||||
this.reset();
|
||||
|
||||
document.body.removeChild(document.getElementById('sw-wrapper'));
|
||||
},
|
||||
|
||||
close: function () {
|
||||
this.swWrapper.style.webkitTransitionTimingFunction = 'ease-in';
|
||||
this.swWrapper.style.webkitTransitionDuration = '400ms';
|
||||
this.swWrapper.style.webkitTransform = 'translate3d(0, 0, 0)';
|
||||
|
||||
this.swWrapper.addEventListener('webkitTransitionEnd', this, false);
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Generic methods
|
||||
*
|
||||
*/
|
||||
|
||||
addSlot: function (values, style, defaultValue) {
|
||||
if (!style) {
|
||||
style = '';
|
||||
}
|
||||
|
||||
style = style.split(' ');
|
||||
|
||||
for (var i = 0; i < style.length; i += 1) {
|
||||
style[i] = 'sw-' + style[i];
|
||||
}
|
||||
|
||||
style = style.join(' ');
|
||||
|
||||
var obj = { 'values': values, 'style': style, 'defaultValue': defaultValue };
|
||||
this.slotData.push(obj);
|
||||
},
|
||||
|
||||
getSelectedValues: function () {
|
||||
var index, count,
|
||||
i, l,
|
||||
keys = [], values = [];
|
||||
|
||||
for (i in this.slotEl) {
|
||||
// Remove any residual animation
|
||||
this.slotEl[i].removeEventListener('webkitTransitionEnd', this, false);
|
||||
this.slotEl[i].style.webkitTransitionDuration = '0';
|
||||
|
||||
if (this.slotEl[i].slotYPosition > 0) {
|
||||
this.setPosition(i, 0);
|
||||
} else if (this.slotEl[i].slotYPosition < this.slotEl[i].slotMaxScroll) {
|
||||
this.setPosition(i, this.slotEl[i].slotMaxScroll);
|
||||
}
|
||||
|
||||
index = -Math.round(this.slotEl[i].slotYPosition / this.cellHeight);
|
||||
|
||||
count = 0;
|
||||
for (l in this.slotData[i].values) {
|
||||
if (count == index) {
|
||||
keys.push(l);
|
||||
values.push(this.slotData[i].values[l]);
|
||||
break;
|
||||
}
|
||||
|
||||
count += 1;
|
||||
}
|
||||
}
|
||||
|
||||
return { 'keys': keys, 'values': values };
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Rolling slots
|
||||
*
|
||||
*/
|
||||
|
||||
setPosition: function (slot, pos) {
|
||||
this.slotEl[slot].slotYPosition = pos;
|
||||
this.slotEl[slot].style.webkitTransform = 'translate3d(0, ' + pos + 'px, 0)';
|
||||
},
|
||||
|
||||
scrollStart: function (e) {
|
||||
// Find the clicked slot
|
||||
var xPos = e.targetTouches[0].clientX - this.swSlots.offsetLeft; // Clicked position minus left offset (should be 11px)
|
||||
|
||||
// Find tapped slot
|
||||
var slot = 0;
|
||||
for (var i = 0; i < this.slotEl.length; i += 1) {
|
||||
slot += this.slotEl[i].slotWidth;
|
||||
|
||||
if (xPos < slot) {
|
||||
this.activeSlot = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If slot is readonly do nothing
|
||||
if (this.slotData[this.activeSlot].style.match('readonly')) {
|
||||
this.swFrame.removeEventListener('touchmove', this, false);
|
||||
this.swFrame.removeEventListener('touchend', this, false);
|
||||
return false;
|
||||
}
|
||||
|
||||
this.slotEl[this.activeSlot].removeEventListener('webkitTransitionEnd', this, false); // Remove transition event (if any)
|
||||
this.slotEl[this.activeSlot].style.webkitTransitionDuration = '0'; // Remove any residual transition
|
||||
|
||||
// Stop and hold slot position
|
||||
var theTransform = window.getComputedStyle(this.slotEl[this.activeSlot]).webkitTransform;
|
||||
theTransform = new WebKitCSSMatrix(theTransform).m42;
|
||||
if (theTransform != this.slotEl[this.activeSlot].slotYPosition) {
|
||||
this.setPosition(this.activeSlot, theTransform);
|
||||
}
|
||||
|
||||
this.startY = e.targetTouches[0].clientY;
|
||||
this.scrollStartY = this.slotEl[this.activeSlot].slotYPosition;
|
||||
this.scrollStartTime = e.timeStamp;
|
||||
|
||||
this.swFrame.addEventListener('touchmove', this, false);
|
||||
this.swFrame.addEventListener('touchend', this, false);
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
scrollMove: function (e) {
|
||||
var topDelta = e.targetTouches[0].clientY - this.startY;
|
||||
|
||||
if (this.slotEl[this.activeSlot].slotYPosition > 0 || this.slotEl[this.activeSlot].slotYPosition < this.slotEl[this.activeSlot].slotMaxScroll) {
|
||||
topDelta /= 2;
|
||||
}
|
||||
|
||||
this.setPosition(this.activeSlot, this.slotEl[this.activeSlot].slotYPosition + topDelta);
|
||||
this.startY = e.targetTouches[0].clientY;
|
||||
|
||||
// Prevent slingshot effect
|
||||
if (e.timeStamp - this.scrollStartTime > 80) {
|
||||
this.scrollStartY = this.slotEl[this.activeSlot].slotYPosition;
|
||||
this.scrollStartTime = e.timeStamp;
|
||||
}
|
||||
},
|
||||
|
||||
scrollEnd: function (e) {
|
||||
this.swFrame.removeEventListener('touchmove', this, false);
|
||||
this.swFrame.removeEventListener('touchend', this, false);
|
||||
|
||||
// If we are outside of the boundaries, let's go back to the sheepfold
|
||||
if (this.slotEl[this.activeSlot].slotYPosition > 0 || this.slotEl[this.activeSlot].slotYPosition < this.slotEl[this.activeSlot].slotMaxScroll) {
|
||||
this.scrollTo(this.activeSlot, this.slotEl[this.activeSlot].slotYPosition > 0 ? 0 : this.slotEl[this.activeSlot].slotMaxScroll);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Lame formula to calculate a fake deceleration
|
||||
var scrollDistance = this.slotEl[this.activeSlot].slotYPosition - this.scrollStartY;
|
||||
|
||||
// The drag session was too short
|
||||
if (scrollDistance < this.cellHeight / 1.5 && scrollDistance > -this.cellHeight / 1.5) {
|
||||
if (this.slotEl[this.activeSlot].slotYPosition % this.cellHeight) {
|
||||
this.scrollTo(this.activeSlot, Math.round(this.slotEl[this.activeSlot].slotYPosition / this.cellHeight) * this.cellHeight, '100ms');
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
var scrollDuration = e.timeStamp - this.scrollStartTime;
|
||||
|
||||
var newDuration = (2 * scrollDistance / scrollDuration) / this.friction;
|
||||
var newScrollDistance = (this.friction / 2) * (newDuration * newDuration);
|
||||
|
||||
if (newDuration < 0) {
|
||||
newDuration = -newDuration;
|
||||
newScrollDistance = -newScrollDistance;
|
||||
}
|
||||
|
||||
var newPosition = this.slotEl[this.activeSlot].slotYPosition + newScrollDistance;
|
||||
|
||||
if (newPosition > 0) {
|
||||
// Prevent the slot to be dragged outside the visible area (top margin)
|
||||
newPosition /= 2;
|
||||
newDuration /= 3;
|
||||
|
||||
if (newPosition > this.swSlotWrapper.clientHeight / 4) {
|
||||
newPosition = this.swSlotWrapper.clientHeight / 4;
|
||||
}
|
||||
} else if (newPosition < this.slotEl[this.activeSlot].slotMaxScroll) {
|
||||
// Prevent the slot to be dragged outside the visible area (bottom margin)
|
||||
newPosition = (newPosition - this.slotEl[this.activeSlot].slotMaxScroll) / 2 + this.slotEl[this.activeSlot].slotMaxScroll;
|
||||
newDuration /= 3;
|
||||
|
||||
if (newPosition < this.slotEl[this.activeSlot].slotMaxScroll - this.swSlotWrapper.clientHeight / 4) {
|
||||
newPosition = this.slotEl[this.activeSlot].slotMaxScroll - this.swSlotWrapper.clientHeight / 4;
|
||||
}
|
||||
} else {
|
||||
newPosition = Math.round(newPosition / this.cellHeight) * this.cellHeight;
|
||||
}
|
||||
|
||||
this.scrollTo(this.activeSlot, Math.round(newPosition), Math.round(newDuration) + 'ms');
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
scrollTo: function (slotNum, dest, runtime) {
|
||||
this.slotEl[slotNum].style.webkitTransitionDuration = runtime ? runtime : '100ms';
|
||||
this.setPosition(slotNum, dest ? dest : 0);
|
||||
|
||||
// If we are outside of the boundaries go back to the sheepfold
|
||||
if (this.slotEl[slotNum].slotYPosition > 0 || this.slotEl[slotNum].slotYPosition < this.slotEl[slotNum].slotMaxScroll) {
|
||||
this.slotEl[slotNum].addEventListener('webkitTransitionEnd', this, false);
|
||||
}
|
||||
},
|
||||
|
||||
scrollToValue: function (slot, value) {
|
||||
var yPos, count, i;
|
||||
|
||||
this.slotEl[slot].removeEventListener('webkitTransitionEnd', this, false);
|
||||
this.slotEl[slot].style.webkitTransitionDuration = '0';
|
||||
|
||||
count = 0;
|
||||
for (i in this.slotData[slot].values) {
|
||||
if (i == value) {
|
||||
yPos = count * this.cellHeight;
|
||||
this.setPosition(slot, yPos);
|
||||
break;
|
||||
}
|
||||
|
||||
count -= 1;
|
||||
}
|
||||
},
|
||||
|
||||
backWithinBoundaries: function (e) {
|
||||
e.target.removeEventListener('webkitTransitionEnd', this, false);
|
||||
|
||||
this.scrollTo(e.target.slotPosition, e.target.slotYPosition > 0 ? 0 : e.target.slotMaxScroll, '150ms');
|
||||
return false;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Buttons
|
||||
*
|
||||
*/
|
||||
|
||||
tapDown: function (e) {
|
||||
e.currentTarget.addEventListener('touchmove', this, false);
|
||||
e.currentTarget.addEventListener('touchend', this, false);
|
||||
e.currentTarget.className = 'sw-pressed';
|
||||
},
|
||||
|
||||
tapCancel: function (e) {
|
||||
e.currentTarget.removeEventListener('touchmove', this, false);
|
||||
e.currentTarget.removeEventListener('touchend', this, false);
|
||||
e.currentTarget.className = '';
|
||||
},
|
||||
|
||||
tapUp: function (e) {
|
||||
this.tapCancel(e);
|
||||
|
||||
if (e.currentTarget.id == 'sw-cancel') {
|
||||
this.cancelAction();
|
||||
} else {
|
||||
this.doneAction();
|
||||
}
|
||||
|
||||
this.close();
|
||||
},
|
||||
|
||||
setCancelAction: function (action) {
|
||||
this.cancelAction = action;
|
||||
},
|
||||
|
||||
setDoneAction: function (action) {
|
||||
this.doneAction = action;
|
||||
},
|
||||
|
||||
cancelAction: function () {
|
||||
return false;
|
||||
},
|
||||
|
||||
cancelDone: function () {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
82
mobile/apple/php/rss.php
Normal file
@ -0,0 +1,82 @@
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
// define the namespaces that we are interested in
|
||||
$ns = array
|
||||
(
|
||||
"content" => "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;
|
||||
?>
|
||||
<?php
|
||||
$article["comments"] = $item->comments;
|
||||
$article["timestamp"] = strtotime($item->pubDate);
|
||||
?>
|
||||
<ul class="pageitem">
|
||||
<li class="textbox"><span class="header"> <?php echo $article["title"] = $item->title;?></span>
|
||||
<?php echo $article["description"] = (string) trim($item->description);?>
|
||||
</li>
|
||||
<li class="menu">
|
||||
<a href="<?php echo $article["link"] = $item->link;?>">
|
||||
<img alt="Description" src="thumbs/safari.png" />
|
||||
<span class="name">View</span>
|
||||
<span class="comment"><?php echo $article["pubDate"] = $item->pubDate;?></span>
|
||||
<span class="arrow"></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<?php
|
||||
$article["isPermaLink"] = $item->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
|
||||
|
||||
|
||||
|
||||
?>
|
||||
BIN
mobile/apple/thumbs/accessibility.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
mobile/apple/thumbs/appstore.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
mobile/apple/thumbs/basics.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
mobile/apple/thumbs/calculator.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
mobile/apple/thumbs/calendar.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
mobile/apple/thumbs/calendar2.png
Normal file
|
After Width: | Height: | Size: 536 B |
BIN
mobile/apple/thumbs/camera.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
mobile/apple/thumbs/clock.png
Normal file
|
After Width: | Height: | Size: 1014 B |
BIN
mobile/apple/thumbs/compass.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
mobile/apple/thumbs/contacts.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
mobile/apple/thumbs/help.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
mobile/apple/thumbs/ipod.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
mobile/apple/thumbs/itunes.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
mobile/apple/thumbs/iwebkit.png
Normal file
|
After Width: | Height: | Size: 839 B |
BIN
mobile/apple/thumbs/mail.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
mobile/apple/thumbs/maps.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
mobile/apple/thumbs/messages.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
mobile/apple/thumbs/music.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
mobile/apple/thumbs/nike+.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
mobile/apple/thumbs/notepad.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
mobile/apple/thumbs/other.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
mobile/apple/thumbs/otherapps.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
mobile/apple/thumbs/photos.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
mobile/apple/thumbs/plugin.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
mobile/apple/thumbs/safari.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
mobile/apple/thumbs/settings.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
mobile/apple/thumbs/sketches.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
mobile/apple/thumbs/sms.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
mobile/apple/thumbs/start.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
mobile/apple/thumbs/stocks.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
mobile/apple/thumbs/telephone.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
mobile/apple/thumbs/video.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
mobile/apple/thumbs/voice.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
mobile/apple/thumbs/weather.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
mobile/apple/thumbs/wordpress.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
mobile/apple/thumbs/youtube.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
4
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.'" }';
|
||||
|
||||
|
||||
62
view.css
@ -64,13 +64,13 @@ form.appnitro
|
||||
padding:0;
|
||||
text-decoration:none;
|
||||
text-indent:-8000px;
|
||||
background-image: url('../../../images/machform.gif');
|
||||
background-repeat: no-repeat;
|
||||
/*background-image: url('../../../images/machform.gif');
|
||||
background-repeat: no-repeat;*/
|
||||
}
|
||||
|
||||
#main_body h1 a
|
||||
{
|
||||
|
||||
|
||||
display:block;
|
||||
height:100%;
|
||||
min-height:40px;
|
||||
@ -581,7 +581,7 @@ form.appnitro
|
||||
}
|
||||
|
||||
/*** Success Message ****/
|
||||
.form_success
|
||||
.form_success
|
||||
{
|
||||
clear: both;
|
||||
margin: 0;
|
||||
@ -668,13 +668,13 @@ form.appnitro
|
||||
.embed form.appnitro
|
||||
{
|
||||
margin:0px 0px 0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/** Integrated Form **/
|
||||
.integrated *{
|
||||
font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
|
||||
color: #000;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.integrated #top, .integrated #bottom, .integrated h1{
|
||||
@ -700,7 +700,7 @@ form.appnitro
|
||||
.integrated form.appnitro
|
||||
{
|
||||
margin:0px 0px 0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.integrated form .section_break h3
|
||||
@ -711,7 +711,7 @@ form.appnitro
|
||||
.integrated #error_message h3
|
||||
{
|
||||
border: none !important;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -738,60 +738,60 @@ font-size: 11px;
|
||||
font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
|
||||
}
|
||||
|
||||
.calendar .button {
|
||||
text-align: center;
|
||||
padding: 2px;
|
||||
.calendar .button {
|
||||
text-align: center;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.calendar .nav {
|
||||
background:#f5f5f5;
|
||||
}
|
||||
|
||||
.calendar thead .title {
|
||||
font-weight: bold;
|
||||
.calendar thead .title {
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
background: #dedede;
|
||||
color: #000;
|
||||
padding: 2px 0 3px 0;
|
||||
}
|
||||
|
||||
.calendar thead .headrow {
|
||||
.calendar thead .headrow {
|
||||
background: #f5f5f5;
|
||||
color: #444;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
.calendar thead .daynames {
|
||||
.calendar thead .daynames {
|
||||
background: #fff;
|
||||
color:#333;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
.calendar thead .name {
|
||||
.calendar thead .name {
|
||||
border-bottom: 1px dotted #ccc;
|
||||
padding: 2px;
|
||||
text-align: center;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.calendar thead .weekend {
|
||||
.calendar thead .weekend {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.calendar thead .hilite {
|
||||
.calendar thead .hilite {
|
||||
background-color: #444;
|
||||
color: #fff;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar thead .active {
|
||||
.calendar thead .active {
|
||||
background-color: #d12f19;
|
||||
color:#fff;
|
||||
padding: 2px 0px 0px 2px;
|
||||
}
|
||||
|
||||
|
||||
.calendar tbody .day {
|
||||
.calendar tbody .day {
|
||||
width:1.8em;
|
||||
color: #222;
|
||||
text-align: right;
|
||||
@ -819,19 +819,19 @@ background: #FFF1AF;
|
||||
background: #FFF1AF;
|
||||
}
|
||||
|
||||
.calendar tbody td.hilite {
|
||||
.calendar tbody td.hilite {
|
||||
padding: 1px 1px 1px 1px;
|
||||
background:#444 !important;
|
||||
color:#fff !important;
|
||||
}
|
||||
|
||||
.calendar tbody td.active {
|
||||
.calendar tbody td.active {
|
||||
color:#fff;
|
||||
background: #529214 !important;
|
||||
padding: 2px 2px 0px 2px;
|
||||
}
|
||||
|
||||
.calendar tbody td.selected {
|
||||
.calendar tbody td.selected {
|
||||
font-weight: bold;
|
||||
border: 1px solid #888;
|
||||
padding: 1px 1px 1px 1px;
|
||||
@ -839,11 +839,11 @@ background: #f5f5f5 !important;
|
||||
color: #222 !important;
|
||||
}
|
||||
|
||||
.calendar tbody td.weekend {
|
||||
.calendar tbody td.weekend {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.calendar tbody td.today {
|
||||
.calendar tbody td.today {
|
||||
font-weight: bold;
|
||||
color: #529214;
|
||||
background:#D9EFC2;
|
||||
@ -851,21 +851,21 @@ background:#D9EFC2;
|
||||
|
||||
.calendar tbody .disabled { color: #999; }
|
||||
|
||||
.calendar tbody .emptycell {
|
||||
.calendar tbody .emptycell {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.calendar tbody .emptyrow {
|
||||
.calendar tbody .emptyrow {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.calendar tfoot .footrow {
|
||||
.calendar tfoot .footrow {
|
||||
text-align: center;
|
||||
background: #556;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.calendar tfoot .ttip {
|
||||
.calendar tfoot .ttip {
|
||||
background: #222;
|
||||
color: #fff;
|
||||
font-size:10px;
|
||||
@ -873,14 +873,14 @@ border-top: 1px solid #dedede;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
.calendar tfoot .hilite {
|
||||
.calendar tfoot .hilite {
|
||||
background: #aaf;
|
||||
border: 1px solid #04f;
|
||||
color: #000;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar tfoot .active {
|
||||
.calendar tfoot .active {
|
||||
background: #77c;
|
||||
padding: 2px 0px 0px 2px;
|
||||
}
|
||||
|
||||
37
view.php
@ -1,15 +1,15 @@
|
||||
<?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/
|
||||
******************************************************************************/
|
||||
header("p3p: CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"");
|
||||
session_start();
|
||||
|
||||
|
||||
require('config.php');
|
||||
require('includes/language.php');
|
||||
require('includes/db-core.php');
|
||||
@ -23,39 +23,38 @@
|
||||
require('lib/class.phpmailer.php');
|
||||
require('lib/recaptchalib.php');
|
||||
require('lib/php-captcha/php-captcha.inc.php');
|
||||
|
||||
|
||||
//get data from database
|
||||
connect_db();
|
||||
|
||||
|
||||
if(!empty($_POST['submit'])){ //if form submitted
|
||||
$input_array = ap_sanitize_input($_POST);
|
||||
|
||||
|
||||
$submit_result = process_form($input_array);
|
||||
|
||||
|
||||
if(!isset($input_array['password'])){ //if normal form submitted
|
||||
if($submit_result['status'] === true){
|
||||
if(empty($submit_result['review_id'])){
|
||||
if(empty($submit_result['form_redirect'])){
|
||||
$ssl_suffix = get_ssl_suffix();
|
||||
|
||||
header("Location: http{$ssl_suffix}://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?id={$input_array['form_id']}&done=1");
|
||||
$ssl_suffix = get_ssl_suffix();
|
||||
header("Location: http{$ssl_suffix}://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?id=".base64_encode($input_array['form_id'])."&done=1");
|
||||
exit;
|
||||
}else{
|
||||
echo "<script type=\"text/javascript\">top.location.replace('{$submit_result['form_redirect']}')</script>";
|
||||
exit;
|
||||
}
|
||||
}else{ //redirect to review page
|
||||
$ssl_suffix = get_ssl_suffix();
|
||||
|
||||
$ssl_suffix = get_ssl_suffix();
|
||||
|
||||
$_SESSION['review_id'] = $submit_result['review_id'];
|
||||
header("Location: http{$ssl_suffix}://".$_SERVER['HTTP_HOST'].get_dirname($_SERVER['PHP_SELF'])."/confirm.php?id={$input_array['form_id']}");
|
||||
header("Location: http{$ssl_suffix}://".$_SERVER['HTTP_HOST'].get_dirname($_SERVER['PHP_SELF'])."/confirm.php?id=".base64_encode($input_array['form_id']));
|
||||
exit;
|
||||
}
|
||||
}else{
|
||||
$old_values = $submit_result['old_values'];
|
||||
$custom_error = @$submit_result['custom_error'];
|
||||
$error_elements = $submit_result['error_elements'];
|
||||
|
||||
|
||||
$markup = display_form($input_array['form_id'],$old_values,$error_elements,$custom_error);
|
||||
}
|
||||
}else{ //if password form submitted
|
||||
@ -67,26 +66,26 @@
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$form_id = (int) trim($_GET['id']);
|
||||
$form_id = (int) base64_decode(trim($_GET['id']));
|
||||
if(empty($form_id)){
|
||||
die('ID required.');
|
||||
}
|
||||
|
||||
|
||||
//check for delete file option
|
||||
//this is available for form with review enabled
|
||||
if(!empty($_GET['delete_file']) && !empty($_SESSION['review_id'])){
|
||||
$element_id = (int) trim($_GET['delete_file']);
|
||||
delete_review_file_entry($form_id,$_SESSION['review_id'],$element_id);
|
||||
}
|
||||
|
||||
|
||||
if(!empty($_GET['done'])){
|
||||
$markup = display_success($form_id);
|
||||
}else{
|
||||
$markup = display_form($form_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
header("Content-Type: text/html; charset=UTF-8");
|
||||
echo $markup;
|
||||
|
||||
|
||||
?>
|
||||
|
||||