MatchForm 2.3 original
git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_FormulariosCalidad/trunk@1 e2c41b2c-0c6f-0149-8b81-50b1a9191bb3
16
INSTALL.TXT
Normal file
@ -0,0 +1,16 @@
|
||||
INSTALLATION
|
||||
============
|
||||
|
||||
For the most up to date installation instructions go to:
|
||||
|
||||
http://www.appnitro.com/machform/installation
|
||||
|
||||
|
||||
|
||||
|
||||
UPGRADING
|
||||
=========
|
||||
|
||||
If you are upgrading from version 1.2 to version 2 go to:
|
||||
|
||||
http://www.appnitro.com/machform/upgrade_instructions
|
||||
34
ajax_form_activation.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?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');
|
||||
|
||||
$form_id = trim($_POST['form_id']);
|
||||
$operation = trim($_POST['operation']);
|
||||
|
||||
if(!empty($form_id)){
|
||||
|
||||
connect_db();
|
||||
|
||||
if($operation == 'enable'){ //activate this form
|
||||
$query = "update `ap_forms` set form_active=1 where form_id='$form_id'";
|
||||
}elseif ($operation == 'disable'){ //disable this form
|
||||
$query = "update `ap_forms` set form_active=0 where form_id='$form_id'";
|
||||
}
|
||||
|
||||
do_query($query);
|
||||
}
|
||||
|
||||
echo $form_id;
|
||||
?>
|
||||
20
captcha.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?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('lib/php-captcha/php-captcha.inc.php');
|
||||
|
||||
$fonts = array('lib/php-captcha/VeraSeBd.ttf','lib/php-captcha/VeraBd.ttf');
|
||||
$captcha = new PhpCaptcha($fonts, 200, 60);
|
||||
$captcha->Create();
|
||||
|
||||
?>
|
||||
146
changelog.txt
Normal file
@ -0,0 +1,146 @@
|
||||
MachForm Changelog
|
||||
==================
|
||||
|
||||
===============================
|
||||
VERSION 1.2 - 15 September 2007
|
||||
===============================
|
||||
* New feature: added CAPTCHA for spam protection
|
||||
* New feature: added panel to embed form code
|
||||
* Bugfix on entry manager, column header didn't escape newlines, this break the whole extjs grid javascript
|
||||
* Bugfix on excel export for UTF-8 encoding
|
||||
* Bugfix on email name saving
|
||||
* Bugfix on today's entry counter
|
||||
* Bugfix on domain guessing for mail
|
||||
* Bugfix on mkdir umask
|
||||
* Bugfix on redirect for iframe
|
||||
* Enhanchement on entry manager, provided a constant to limit the maximum columns to be displayed, large forms tend to be slower
|
||||
* Expand last used tab on form manager
|
||||
|
||||
===============================
|
||||
VERSION 1.2.b - 4 November 2007
|
||||
===============================
|
||||
* Bugfix on form submission anchor, it does not go to the top of the page where the error message is.
|
||||
* Bugfix on export to excel. temporary folder wasn't explicitly configured, causing problem to some.
|
||||
* Bugfix on email field ordering
|
||||
* Bugfix on export to excel. header ordering.
|
||||
|
||||
===============================
|
||||
VERSION 1.2.c - 15 November 2007
|
||||
===============================
|
||||
* Bugfix on export to excel. unexpected repeated data.
|
||||
|
||||
===============================
|
||||
VERSION 1.2.d - 28 November 2007
|
||||
===============================
|
||||
* Bugfix on export to excel. header ordering fix somehow missed from the previous release.
|
||||
|
||||
===============================
|
||||
VERSION 1.2.e - 20 February 2008
|
||||
===============================
|
||||
* Small bugfix on CSS for IE7.
|
||||
|
||||
===============================
|
||||
VERSION 1.2.f - 25 February 2008
|
||||
===============================
|
||||
* Bugfix on section break. Shouldn't be displayed on email.
|
||||
* Bugfix on checkbox with only one option. Doesn't displayed on email and exported files.
|
||||
|
||||
===============================
|
||||
VERSION 2.0 - 28 April 2008
|
||||
===============================
|
||||
* New feature: added email autoresponder control panel
|
||||
* New feature: new html email design
|
||||
* New feature: fully customizable email template
|
||||
* New feature: revamped entry manager
|
||||
* New feature: added email autoresponder control panel
|
||||
* New feature: entry viewer
|
||||
* New feature: printer friendly version of an entry
|
||||
* New feature: forward an entry to email
|
||||
* New feature: form submission review page
|
||||
* New feature: full PHP embed code
|
||||
* New feature: built-in CAPTCHA
|
||||
* New feature: added language file for easy translation
|
||||
* New feature: form duplication
|
||||
* Improved navigation
|
||||
* SSL Support
|
||||
* Numerous minor bugfixes
|
||||
|
||||
===============================
|
||||
VERSION 2.0.b - 30 April 2008
|
||||
===============================
|
||||
* Bugfix on quotes not displayed properly in email
|
||||
* Bugfix on form redirect not being sent properly
|
||||
|
||||
===============================
|
||||
VERSION 2.0.c - 1 May 2008
|
||||
===============================
|
||||
* Bugfix on calendar javascript doesn't loaded properly for DD-MM-YYYY
|
||||
* Improvement: full UTF-8 encoding in MySQL table
|
||||
|
||||
===============================
|
||||
VERSION 2.0.d - 5 May 2008
|
||||
===============================
|
||||
* Bugfix on website validation.
|
||||
|
||||
===============================
|
||||
VERSION 2.0.e - 7 May 2008
|
||||
===============================
|
||||
* Added charset header to config file, to force UTF-8 encoding.
|
||||
|
||||
===============================
|
||||
VERSION 2.0.f - 21 May 2008
|
||||
===============================
|
||||
* Typo in template variables page for {form_data}. Should be {entry_data}.
|
||||
* Added translation into language file for review page buttons.
|
||||
* Bugfix: Checkboxes trimming 'b' and 'r' characters at the end of the label.
|
||||
* Bugfix: Email validation doesn't allow single character domain.
|
||||
* Bugfix: Updating checkboxes more than 10 options caused error.
|
||||
* Bugfix: When deleting fields, column preference for that field should be removed.
|
||||
* Bugfix: Saving large form on PHP 5.2.x sometimes doesn't work.
|
||||
|
||||
===============================
|
||||
VERSION 2.0.g - 16 June 2008
|
||||
===============================
|
||||
* Bugfix: Using advanced form code, Enter key won't submit password form in IE7.
|
||||
* Bugfix: Form redirect is not being sent properly when using advanced form code.
|
||||
* Bugfix: IE7 reject CAPTCHA cookies when using iframe code.
|
||||
* Bugfix: IE7 reject session cookies for form review.
|
||||
|
||||
===============================
|
||||
VERSION 2.1 - 11 November 2008
|
||||
===============================
|
||||
* PHPMailer library upgrade. Now support secure SMTP (TLS/SSL).
|
||||
* Added UPLOAD_DIR into config file, to separate upload folder with data folder.
|
||||
* Added file upload type checking.
|
||||
* Added random token to file upload, increased security.
|
||||
* Added default .htaccess file, increased security.
|
||||
* Bugfix: Zero values are not displayed properly on review page and email.
|
||||
* Bugfix: Dropdowns and checkboxes are having maximum value of 255.
|
||||
* Bugfix: '0' values are not being saved for dropdown/multiple choices
|
||||
* Bugfix: Uploading file with quotes doesn't work properly.
|
||||
* Bugfix: Download link in exported excel file doesn't work properly.
|
||||
|
||||
===============================
|
||||
VERSION 2.1.b - 13 November 2008
|
||||
===============================
|
||||
* Bugfix: .htaccess file caused error on some server.
|
||||
|
||||
===============================
|
||||
VERSION 2.2 - 15 May 2009
|
||||
===============================
|
||||
* Bugfix: Uploaded files are having broken link in the email when the form is using advanced form code.
|
||||
* Bugfix: File upload type shouldn't be checked if the field is not required and left empty.
|
||||
* Bugfix: Apostrophe causing error for field being set as unique.
|
||||
* Bugfix: Editing empty date/time field within the admin causing error value for those fields.
|
||||
* Bugfix: Checkboxes doesn't completely exported after some options being deleted.
|
||||
* Bugfix: Linebreak doesn't displayed properly on field labels or section break.
|
||||
|
||||
===============================
|
||||
VERSION 2.3 - 24 March 2010
|
||||
===============================
|
||||
* Bugfix: Double linebreak within form description.
|
||||
* Bugfix: Linebreak within excel causing weird ascii characters.
|
||||
* Bugfix: Excess head tag at review page when using the advanced form code.
|
||||
* Bugfix: Uploading file with quotes doesn't work properly when form review being enabled.
|
||||
* Bugfix: Required file upload field doesn't validate properly when form review enabled and back button pressed.
|
||||
* Bugfix: Removed any deprecated messages within form view, form editor and excel export due to PHP 5.3 new rules.
|
||||
283
columns_preference.php
Normal file
@ -0,0 +1,283 @@
|
||||
<?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');
|
||||
require('includes/db-functions.php');
|
||||
require('includes/helper-functions.php');
|
||||
|
||||
define('MAX_TITLE_LENGTH',100);
|
||||
|
||||
connect_db();
|
||||
|
||||
$form_id = (int) trim($_REQUEST['id']);
|
||||
|
||||
|
||||
//handle form submit
|
||||
if(!empty($_POST['submit'])){
|
||||
//get inputs
|
||||
$total_field = (int) trim($_POST['total_col']);
|
||||
$new_column_prefs = array();
|
||||
|
||||
for ($i=1;$i<=$total_field;$i++){
|
||||
$element_name = trim($_POST['col_pref_'.$i]);
|
||||
if(!empty($element_name)){
|
||||
$new_column_prefs[$i] = $element_name;
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($new_column_prefs)){
|
||||
//delete previous entries
|
||||
do_query("delete from `ap_column_preferences` where form_id='{$form_id}'");
|
||||
|
||||
//insert new preferences
|
||||
foreach ($new_column_prefs as $position=>$element_name){
|
||||
do_query("insert into `ap_column_preferences`(form_id,element_name,position) values('{$form_id}','{$element_name}','{$position}')");
|
||||
}
|
||||
|
||||
$_SESSION['AP_SUCCESS']['title'] = 'Success';
|
||||
$_SESSION['AP_SUCCESS']['desc'] = 'Columns preference successfully saved.';
|
||||
|
||||
header("Location: manage_entries.php?id={$form_id}");
|
||||
exit;
|
||||
}else{
|
||||
$_SESSION['AP_ERROR']['title'] = 'An error occured while saving';
|
||||
$_SESSION['AP_ERROR']['desc'] = 'Please select at least one column.';
|
||||
}
|
||||
}
|
||||
|
||||
//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'];
|
||||
|
||||
//get form element options
|
||||
$query = "select element_id,option_id,`option` from ap_element_options where form_id='$form_id' and live=1 order by element_id,option_id asc";
|
||||
$result = do_query($query);
|
||||
while($row = do_fetch_result($result)){
|
||||
$element_id = $row['element_id'];
|
||||
$option_id = $row['option_id'];
|
||||
|
||||
//limit the data length
|
||||
if(strlen($row['option']) > MAX_TITLE_LENGTH){
|
||||
$element_option_lookup[$element_id][$option_id] = htmlspecialchars(substr($row['option'],0,MAX_TITLE_LENGTH),ENT_QUOTES);
|
||||
}else{
|
||||
$element_option_lookup[$element_id][$option_id] = htmlspecialchars($row['option'],ENT_QUOTES);
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************************/
|
||||
//prepare column header names lookup
|
||||
$query = "select element_id,element_title,element_type,element_constraint from `ap_form_elements` where form_id='$form_id' and element_type != 'section' order by element_position asc";
|
||||
$result = do_query($query);
|
||||
|
||||
$column_name_lookup['date_created'] = 'Date Created';
|
||||
$column_name_lookup['date_updated'] = 'Date Updated';
|
||||
$column_name_lookup['ip_address'] = 'IP Address';
|
||||
|
||||
while($row = do_fetch_result($result)){
|
||||
$element_type = $row['element_type'];
|
||||
$element_constraint = $row['element_constraint'];
|
||||
|
||||
//limit the title length
|
||||
if(strlen($row['element_title']) > MAX_TITLE_LENGTH){
|
||||
$row['element_title'] = substr($row['element_title'],0,MAX_TITLE_LENGTH);
|
||||
}
|
||||
|
||||
$row['element_title'] = htmlspecialchars($row['element_title']);
|
||||
|
||||
if('address' == $element_type){ //address has 6 fields
|
||||
$column_name_lookup['element_'.$row['element_id'].'_1'] = $row['element_title'].' - Street Address';
|
||||
$column_name_lookup['element_'.$row['element_id'].'_2'] = 'Address Line 2';
|
||||
$column_name_lookup['element_'.$row['element_id'].'_3'] = 'City';
|
||||
$column_name_lookup['element_'.$row['element_id'].'_4'] = 'State/Province/Region';
|
||||
$column_name_lookup['element_'.$row['element_id'].'_5'] = 'Zip/Postal Code';
|
||||
$column_name_lookup['element_'.$row['element_id'].'_6'] = 'Country';
|
||||
|
||||
$column_type_lookup['element_'.$row['element_id'].'_1'] = $row['element_type'];
|
||||
$column_type_lookup['element_'.$row['element_id'].'_2'] = $row['element_type'];
|
||||
$column_type_lookup['element_'.$row['element_id'].'_3'] = $row['element_type'];
|
||||
$column_type_lookup['element_'.$row['element_id'].'_4'] = $row['element_type'];
|
||||
$column_type_lookup['element_'.$row['element_id'].'_5'] = $row['element_type'];
|
||||
$column_type_lookup['element_'.$row['element_id'].'_6'] = $row['element_type'];
|
||||
|
||||
}elseif ('simple_name' == $element_type){ //simple name has 2 fields
|
||||
$column_name_lookup['element_'.$row['element_id'].'_1'] = $row['element_title'].' - First';
|
||||
$column_name_lookup['element_'.$row['element_id'].'_2'] = $row['element_title'].' - Last';
|
||||
|
||||
$column_type_lookup['element_'.$row['element_id'].'_1'] = $row['element_type'];
|
||||
$column_type_lookup['element_'.$row['element_id'].'_2'] = $row['element_type'];
|
||||
|
||||
}elseif ('name' == $element_type){ //name has 4 fields
|
||||
$column_name_lookup['element_'.$row['element_id'].'_1'] = $row['element_title'].' - Title';
|
||||
$column_name_lookup['element_'.$row['element_id'].'_2'] = $row['element_title'].' - First';
|
||||
$column_name_lookup['element_'.$row['element_id'].'_3'] = $row['element_title'].' - Last';
|
||||
$column_name_lookup['element_'.$row['element_id'].'_4'] = $row['element_title'].' - Suffix';
|
||||
|
||||
$column_type_lookup['element_'.$row['element_id'].'_1'] = $row['element_type'];
|
||||
$column_type_lookup['element_'.$row['element_id'].'_2'] = $row['element_type'];
|
||||
$column_type_lookup['element_'.$row['element_id'].'_3'] = $row['element_type'];
|
||||
$column_type_lookup['element_'.$row['element_id'].'_4'] = $row['element_type'];
|
||||
|
||||
}elseif('money' == $element_type){//money format
|
||||
$column_name_lookup['element_'.$row['element_id']] = $row['element_title'];
|
||||
if(!empty($element_constraint)){
|
||||
$column_type_lookup['element_'.$row['element_id']] = $element_constraint; //euro, pound, yen
|
||||
}else{
|
||||
$column_type_lookup['element_'.$row['element_id']] = 'dollar'; //default is dollar
|
||||
}
|
||||
}elseif('checkbox' == $element_type){ //checkboxes, get childs elements
|
||||
|
||||
$this_checkbox_options = $element_option_lookup[$row['element_id']];
|
||||
foreach ($this_checkbox_options as $option_id=>$option){
|
||||
$column_name_lookup['element_'.$row['element_id'].'_'.$option_id] = $option;
|
||||
$column_type_lookup['element_'.$row['element_id'].'_'.$option_id] = $row['element_type'];
|
||||
}
|
||||
}else{ //for other elements with only 1 field
|
||||
$column_name_lookup['element_'.$row['element_id']] = $row['element_title'];
|
||||
$column_type_lookup['element_'.$row['element_id']] = $row['element_type'];
|
||||
}
|
||||
}
|
||||
/******************************************************************************************/
|
||||
|
||||
//get values from ap_column_preferences table
|
||||
$query = "select element_name from ap_column_preferences where form_id='{$form_id}'";
|
||||
$result = do_query($query);
|
||||
|
||||
$column_prefs = array();
|
||||
while($row = do_fetch_result($result)){
|
||||
$column_prefs[] = $row['element_name'];
|
||||
}
|
||||
|
||||
$header_data =<<<EOT
|
||||
<script src="js/jquery/jquery-core.js"></script>
|
||||
<script src="js/jquery/jquery-columnhover.js"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$('#cp_list_table').columnHover();
|
||||
$('#form_columns_preference').find("input[@type$='checkbox']").not('#col_select').click(function(){
|
||||
if(this.checked == true){
|
||||
$('#img_' + this.value).attr("src",'images/icons/checkbox_16.gif');
|
||||
}else{
|
||||
$('#img_' + this.value).attr("src",'images/icons/cross_16.gif');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function toggle_select(){
|
||||
var main_checkbox = $('#col_select').attr("checked");
|
||||
$('#form_columns_preference').find("input[@type$='checkbox']").not('#col_select').each(function(){
|
||||
this.checked = main_checkbox;
|
||||
});
|
||||
|
||||
var image_src = '';
|
||||
if(main_checkbox == true){
|
||||
image_src = 'images/icons/checkbox_16.gif';
|
||||
}else{
|
||||
image_src = 'images/icons/cross_16.gif';
|
||||
}
|
||||
|
||||
$('#form_columns_preference').find(".cb_images").each(function(){
|
||||
this.src = image_src;
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
<style type="text/css">
|
||||
#cp_list_table tbody tr:hover
|
||||
{
|
||||
background-color: LemonChiffon;
|
||||
}
|
||||
.cp_small{
|
||||
width: 30px;
|
||||
padding: 0px !important;
|
||||
}
|
||||
.cp_checkbox{
|
||||
width: 15px !important;
|
||||
text-align: center !important;
|
||||
padding-right: 2px !important;
|
||||
|
||||
}
|
||||
</style>
|
||||
EOT;
|
||||
|
||||
?>
|
||||
|
||||
<?php require('includes/header.php'); ?>
|
||||
|
||||
|
||||
<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" /> <a class="breadcrumb" href="manage_entries.php?id=<?php echo $form_id; ?>">Entries</a> <img src="images/icons/resultset_next.gif" align="bottom" /> Choose Columns</h2>
|
||||
<p>Specify which columns are displayed in Entries table</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="columns_preference">
|
||||
<div id="cp_list">
|
||||
<form id="form_columns_preference" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
|
||||
<table id="cp_list_table" width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" style="border-right: none" class="cp_checkbox"><input type="checkbox" id="col_select" name="col_select" value="1" onclick="toggle_select()" /></th>
|
||||
<th scope="col" style="border-right: none">Choose columns to be displayed:</th>
|
||||
<th scope="col" class="cp_small"> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$toggle = false;
|
||||
$i = 1;
|
||||
foreach ($column_name_lookup as $element_name=>$element_label){
|
||||
if($toggle){
|
||||
$toggle = false;
|
||||
$row_style = 'class="alt"';
|
||||
}else{
|
||||
$toggle = true;
|
||||
$row_style = '';
|
||||
}
|
||||
|
||||
if(in_array($element_name,$column_prefs)){
|
||||
$checked = 'checked="checked"';
|
||||
$img_name = 'checkbox_16.gif';
|
||||
}else{
|
||||
$checked = '';
|
||||
$img_name = 'cross_16.gif';
|
||||
}
|
||||
|
||||
$table_row =<<<EOT
|
||||
<tr {$row_style}>
|
||||
<td class="cp_checkbox"><input type="checkbox" name="col_pref_{$i}" value="{$element_name}" {$checked} /></td>
|
||||
<td><div>{$element_label}</div></td>
|
||||
<td class="cp_small"><img id="img_{$element_name}" class="cb_images" align="absmiddle" src="images/icons/{$img_name}"/></td>
|
||||
</tr>
|
||||
EOT;
|
||||
echo $table_row;
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table><br />
|
||||
<input type="hidden" name="id" value="<?php echo $form_id; ?>" />
|
||||
<input type="hidden" name="total_col" value="<?php echo --$i; ?>" />
|
||||
<input id="saveForm" class="button_text" type="submit" name="submit" value="Save Changes" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<?php require('includes/footer.php'); ?>
|
||||
59
config-empty.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/*
|
||||
MachForm Configuration File
|
||||
THIS FILE MUST BE RENAMED config.php BEFORE STARTING INSTALLATION
|
||||
*/
|
||||
|
||||
/** MySQL settings **/
|
||||
define('DB_NAME', 'YOUR_DB_NAME'); //The name of your database. Note that this database must exist before running installer.php
|
||||
define('DB_USER', 'YOUR_DB_USER'); //Your database username
|
||||
define('DB_PASSWORD', 'YOUR_DB_PASSWORD'); //Your database users password
|
||||
define('DB_HOST', 'localhost'); //The hostname for your database
|
||||
|
||||
/** Admin user and password **/
|
||||
define('ADMIN_USER','admin');
|
||||
define('ADMIN_PASSWORD','admin');
|
||||
|
||||
|
||||
|
||||
/** Data folder **/
|
||||
/** Folder settings for your CSS files and upload folder **/
|
||||
define('DATA_DIR', './data'); //CSS files folder
|
||||
define('UPLOAD_DIR', './data'); //for maximum security, set full path to any folder outside your document root
|
||||
|
||||
/** File upload limit **/
|
||||
define('UPLOAD_FILETYPE_ALLOW',''); //allow only these filetypes to be uploaded
|
||||
define('UPLOAD_FILETYPE_DENY','php;php3;php4;php5;phtml;exe;pl;cgi;html;htm;js'); //do not allow these filetypes to be uploaded
|
||||
|
||||
|
||||
/** CAPTCHA settings **/
|
||||
/** To use reCAPTCHA you must get an API key from http://recaptcha.net/api/getkey **/
|
||||
define('RECAPTCHA_PUBLIC_KEY','');
|
||||
define('RECAPTCHA_PRIVATE_KEY','');
|
||||
|
||||
/** Set below to 'true' if you prefer to use the internal CAPTCHA implementation instead of reCAPTCHA **/
|
||||
/** GD extension must be enabled in order to use this option **/
|
||||
define('USE_INTERNAL_CAPTCHA',false);
|
||||
|
||||
/** SMTP settings **/
|
||||
/** Don't modify it unless you know you are using SMTP **/
|
||||
define('USE_SMTP',false); //set this to 'true' to use SMTP
|
||||
|
||||
define('SMTP_HOST','localhost');
|
||||
define('SMTP_PORT',25);
|
||||
define('SMTP_AUTH',false); //if your SMTP require authentification, set this to 'true'
|
||||
define('SMTP_USERNAME','YOUR_SMTP_USERNAME');
|
||||
define('SMTP_PASSWORD','YOUR_SMTP_PASSWORD');
|
||||
define('SMTP_SECURE',false); //set this to 'true' if your server is using secure SMTP (TLS/SSL)
|
||||
|
||||
/** Default notification email settings **/
|
||||
define('NOTIFICATION_MAIL_FROM',''); //default is 'no-reply@yourdomain.com'
|
||||
define('NOTIFICATION_MAIL_FROM_NAME',''); //default is 'MachForm'
|
||||
define('NOTIFICATION_MAIL_SUBJECT',''); //default is '{form_name} [#{entry_no}]'
|
||||
|
||||
/** Current MachForm Version **/
|
||||
define('MACHFORM_VERSION','2.3');
|
||||
|
||||
error_reporting(E_ALL ^ E_NOTICE);
|
||||
@header("Content-Type: text/html; charset=UTF-8");
|
||||
?>
|
||||
72
confirm.php
Normal file
@ -0,0 +1,72 @@
|
||||
<?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/language.php');
|
||||
require('includes/db-core.php');
|
||||
require('includes/common-validator.php');
|
||||
require('includes/view-functions.php');
|
||||
require('includes/post-functions.php');
|
||||
require('includes/helper-functions.php');
|
||||
require('includes/entry-functions.php');
|
||||
require('lib/class.phpmailer.php');
|
||||
|
||||
//get data from database
|
||||
connect_db();
|
||||
|
||||
$form_id = (int) trim($_REQUEST['id']);
|
||||
|
||||
if(!empty($_POST['review_submit'])){ //if form submitted
|
||||
|
||||
//commit data from review table to actual table
|
||||
$record_id = $_SESSION['review_id'];
|
||||
$commit_result = commit_form_review($form_id,$record_id);
|
||||
|
||||
unset($_SESSION['review_id']);
|
||||
|
||||
if(empty($commit_result['form_redirect'])){
|
||||
$ssl_suffix = get_ssl_suffix();
|
||||
|
||||
header("Location: http{$ssl_suffix}://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?id={$form_id}&done=1");
|
||||
exit;
|
||||
}else{
|
||||
|
||||
echo "<script type=\"text/javascript\">top.location.replace('{$commit_result['form_redirect']}')</script>";
|
||||
exit;
|
||||
}
|
||||
|
||||
}elseif (!empty($_POST['review_back'])){
|
||||
//go back to form
|
||||
$ssl_suffix = get_ssl_suffix();
|
||||
header("Location: http{$ssl_suffix}://".$_SERVER['HTTP_HOST'].get_dirname($_SERVER['PHP_SELF'])."/view.php?id={$form_id}");
|
||||
exit;
|
||||
}else{
|
||||
|
||||
if(empty($form_id)){
|
||||
die('ID required.');
|
||||
}
|
||||
|
||||
if(!empty($_GET['done'])){
|
||||
$markup = display_success($form_id);
|
||||
}else{
|
||||
if(empty($_SESSION['review_id'])){
|
||||
die("Your session has been expired. Please <a href='view.php?id={$form_id}'>click here</a> to start again.");
|
||||
}else{
|
||||
$record_id = $_SESSION['review_id'];
|
||||
}
|
||||
$markup = display_form_review($form_id,$record_id);
|
||||
}
|
||||
}
|
||||
|
||||
header("Content-Type: text/html; charset=UTF-8");
|
||||
echo $markup;
|
||||
|
||||
?>
|
||||
68
confirm_embed.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?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/language.php');
|
||||
require('includes/db-core.php');
|
||||
require('includes/common-validator.php');
|
||||
require('includes/view-functions.php');
|
||||
require('includes/post-functions.php');
|
||||
require('includes/helper-functions.php');
|
||||
require('includes/entry-functions.php');
|
||||
require('lib/class.phpmailer.php');
|
||||
|
||||
//get data from database
|
||||
connect_db();
|
||||
|
||||
$form_id = (int) trim($_REQUEST['id']);
|
||||
|
||||
if(!empty($_POST['review_submit'])){ //if form submitted
|
||||
//commit data from review table to actual table
|
||||
$record_id = $_SESSION['review_id'];
|
||||
$commit_result = commit_form_review($form_id,$record_id);
|
||||
|
||||
unset($_SESSION['review_id']);
|
||||
|
||||
if(empty($commit_result['form_redirect'])){
|
||||
$ssl_suffix = get_ssl_suffix();
|
||||
header("Location: http{$ssl_suffix}://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?id={$form_id}&done=1");
|
||||
exit;
|
||||
}else{
|
||||
echo "<script type=\"text/javascript\">top.location.replace('{$commit_result['form_redirect']}')</script>";
|
||||
exit;
|
||||
}
|
||||
}elseif (!empty($_POST['review_back'])){
|
||||
//go back to form
|
||||
$ssl_suffix = get_ssl_suffix();
|
||||
header("Location: http{$ssl_suffix}://".$_SERVER['HTTP_HOST'].get_dirname($_SERVER['PHP_SELF'])."/embed.php?id={$form_id}");
|
||||
exit;
|
||||
}else{
|
||||
|
||||
if(empty($form_id)){
|
||||
die('ID required.');
|
||||
}
|
||||
|
||||
if(!empty($_GET['done'])){
|
||||
$markup = display_success($form_id,true);
|
||||
}else{
|
||||
if(empty($_SESSION['review_id'])){
|
||||
die("Your session has been expired. Please <a href='embed.php?id={$form_id}'>click here</a> to start again.");
|
||||
}else{
|
||||
$record_id = $_SESSION['review_id'];
|
||||
}
|
||||
$markup = display_form_review($form_id,$record_id,true);
|
||||
}
|
||||
}
|
||||
|
||||
header("Content-Type: text/html; charset=UTF-8");
|
||||
echo $markup;
|
||||
|
||||
?>
|
||||
BIN
css/blank.gif
Normal file
|
After Width: | Height: | Size: 49 B |
47
css/email_entry.css
Normal file
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* SimpleModal Contact Form
|
||||
* http://www.ericmmartin.com/projects/simplemodal/
|
||||
* http://code.google.com/p/simplemodal/
|
||||
*
|
||||
* Copyright (c) 2007 Eric Martin - http://ericmmartin.com
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
* Revision: $Id: contact.css 114 2008-03-20 00:53:05Z emartin24 $
|
||||
*
|
||||
*/
|
||||
|
||||
body {padding:0; margin:0; height:100%; width:100%;}
|
||||
|
||||
/* Overlay */
|
||||
#contact-overlay {background-color:#000; }
|
||||
|
||||
/* Container */
|
||||
#contact-container {width:420px; left:50%; top:25%; margin-left:-210px; font-family:'Trebuchet MS', Verdana, Arial; font-size:16px; text-align:center;}
|
||||
#contact-container .contact-content {background-color:#144282; color:#ddd; height:40px;}
|
||||
#contact-container h1 {color:#fff; margin:0; padding:20px 0 20px 0px; font-size:1.2em; text-align:center;text-indent: 0px}
|
||||
#contact-container .contact-loading {position:absolute; background:url(../images/simple_modal/ajax-loader.gif) no-repeat; z-index:8000; height:55px; width:54px; margin:-14px 0 0 170px; padding:0;}
|
||||
|
||||
#contact-container .contact-message {text-align:center;}
|
||||
#contact-container .contact-error {width:92%; font-size:.8em; background:#000; border:2px solid #ccc; font-size:0.8em; font-weight:bold; margin:0 auto; padding:2px;}
|
||||
#contact-container br {clear:both;}
|
||||
#contact-container form {padding:0; margin:0;}
|
||||
#contact-container label {clear:left; display:block; width:100px; float:left; text-align:right; padding-right:4px; font-weight:bold;}
|
||||
#contact-container .contact-input {font-family:'Trebuchet MS', Verdana, Arial; padding:2px; margin:2px; background:#eee; border:1px solid #fff; width:350px;text-align: center}
|
||||
#contact-container textarea {height:84px;}
|
||||
#contact-container .contact-top {height:13px; background:url(../images/simple_modal/form_top.gif) no-repeat; padding:0; margin:0;}
|
||||
#contact-container .contact-bottom {height:13px; background:url(../images/simple_modal/form_bottom.gif) no-repeat; font-size:.7em; text-align:center;}
|
||||
#contact-container .contact-bottom a,
|
||||
#contact-container .contact-bottom a:link,
|
||||
#contact-container .contact-bottom a:active,
|
||||
#contact-container .contact-bottom a:visited {position:relative; top:-4px; text-decoration:none; color:#666;}
|
||||
#contact-container .contact-bottom a:hover {color:#888;}
|
||||
#contact-container .contact-button {margin:4px 0 0 4px; cursor:pointer; height:24px; border:0; font-size:1em; font-weight:bold; color:#fff; text-align:center; vertical-align:middle;display: inline !important; float: inherit !important}
|
||||
#contact-container .contact-send {width:50px; background:url(../images/simple_modal/send.png) no-repeat;padding: 0px;}
|
||||
#contact-container .contact-cancel {width:65px; background:url(../images/simple_modal/cancel.png) no-repeat;padding: 0px;}
|
||||
#contact-container a.modalCloseX,
|
||||
#contact-container a.modalCloseX:link,
|
||||
#contact-container a.modalCloseX:active,
|
||||
#contact-container a.modalCloseX:visited {text-decoration:none; font-weight:bold; font-size:1.2em; position:absolute; top:-2px; left:400px; color:#fff;}
|
||||
#contact-container a.modalCloseX:hover {color:#fff;}
|
||||
18
css/email_entry_ie.css
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* SimpleModal Contact Form
|
||||
* http://www.ericmmartin.com/projects/simplemodal/
|
||||
* http://code.google.com/p/simplemodal/
|
||||
*
|
||||
* Copyright (c) 2007 Eric Martin - http://ericmmartin.com
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
* Revision: $Id: contact_ie.css 113 2008-03-15 15:36:21Z emartin24 $
|
||||
*
|
||||
*/
|
||||
|
||||
/* IE 6 hacks*/
|
||||
#contact-container {top:expression((document.documentElement.scrollTop || document.body.scrollTop) + Math.round(15 * (document.documentElement.offsetHeight || document.body.clientHeight) / 100) + 'px');}
|
||||
#contact-container .contact-top {background:url(../img/contact/form_top_ie.gif) no-repeat;}
|
||||
#contact-container form {padding:0; margin:0;}
|
||||
52
css/entry_print.css
Normal file
@ -0,0 +1,52 @@
|
||||
body {
|
||||
background: none !important;
|
||||
margin: 0px !important;
|
||||
padding: 0px !important;
|
||||
font-size : 11pt !important;
|
||||
overflow-y : visible !important;
|
||||
}
|
||||
#form_manager{
|
||||
margin: 0px !important;
|
||||
padding: 0px !important;
|
||||
}
|
||||
#header, #footer{
|
||||
display: none !important;
|
||||
}
|
||||
#top, #bottom{
|
||||
display: none !important;
|
||||
height: 0px !important;
|
||||
}
|
||||
|
||||
#ve_action_container{
|
||||
display: none !important;
|
||||
}
|
||||
#ve_detail{
|
||||
width: 100% !important;
|
||||
float: none !important;
|
||||
}
|
||||
.alt{
|
||||
background-color: #fff !important;
|
||||
}
|
||||
.info{
|
||||
border-bottom: none !important;
|
||||
padding-bottom: 10px !important;
|
||||
}
|
||||
.info p{
|
||||
display: none !important;
|
||||
}
|
||||
.breadcrumb{
|
||||
border-bottom: none !important;
|
||||
color: #000 !important;
|
||||
}
|
||||
#ve_a_entries, #ve_a_next{
|
||||
display: none !important;
|
||||
}
|
||||
.global_message{
|
||||
display: none !important;
|
||||
}
|
||||
#view_entry{
|
||||
overflow: inherit !important;
|
||||
}
|
||||
#panel{
|
||||
overflow: inherit !important;
|
||||
}
|
||||
68
css/iepngfix.htc
Normal file
@ -0,0 +1,68 @@
|
||||
<public:component>
|
||||
<public:attach event="onpropertychange" onevent="doFix()" />
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
// IE5.5+ PNG Alpha Fix v1.0RC4
|
||||
// (c) 2004-2005 Angus Turnbull http://www.twinhelix.com
|
||||
|
||||
// This is licensed under the CC-GNU LGPL, version 2.1 or later.
|
||||
// For details, see: http://creativecommons.org/licenses/LGPL/2.1/
|
||||
|
||||
|
||||
// This must be a path to a blank image. That's all the configuration you need.
|
||||
if (typeof blankImg == 'undefined') var blankImg = 'blank.gif';
|
||||
|
||||
|
||||
var f = 'DXImageTransform.Microsoft.AlphaImageLoader';
|
||||
|
||||
function filt(s, m)
|
||||
{
|
||||
if (filters[f])
|
||||
{
|
||||
filters[f].enabled = s ? true : false;
|
||||
if (s) with (filters[f]) { src = s; sizingMethod = m }
|
||||
}
|
||||
else if (s) style.filter = 'progid:'+f+'(src="'+s+'",sizingMethod="'+m+'")';
|
||||
}
|
||||
|
||||
function doFix()
|
||||
{
|
||||
// Assume IE7 is OK.
|
||||
if (!/MSIE (5\.5|6\.)/.test(navigator.userAgent) ||
|
||||
(event && !/(background|src)/.test(event.propertyName))) return;
|
||||
|
||||
var bgImg = currentStyle.backgroundImage || style.backgroundImage;
|
||||
|
||||
if (tagName == 'IMG')
|
||||
{
|
||||
if ((/\.png$/i).test(src))
|
||||
{
|
||||
if (currentStyle.width == 'auto' && currentStyle.height == 'auto')
|
||||
style.width = offsetWidth + 'px';
|
||||
filt(src, 'scale');
|
||||
src = blankImg;
|
||||
}
|
||||
else if (src.indexOf(blankImg) < 0) filt();
|
||||
}
|
||||
else if (bgImg && bgImg != 'none')
|
||||
{
|
||||
if (bgImg.match(/^url[("']+(.*\.png)[)"']+$/i))
|
||||
{
|
||||
var s = RegExp.$1;
|
||||
if (currentStyle.width == 'auto' && currentStyle.height == 'auto')
|
||||
style.width = offsetWidth + 'px';
|
||||
style.backgroundImage = 'none';
|
||||
filt(s, 'crop');
|
||||
// IE link fix.
|
||||
for (var n = 0; n < childNodes.length; n++)
|
||||
if (childNodes[n].style) childNodes[n].style.position = 'relative';
|
||||
}
|
||||
else filt();
|
||||
}
|
||||
}
|
||||
|
||||
doFix();
|
||||
|
||||
</script>
|
||||
</public:component>
|
||||
107
css/jquery-tabs.css
Normal file
@ -0,0 +1,107 @@
|
||||
.ui-wrapper { border: 1px solid #50A029; }
|
||||
.ui-wrapper input, .ui-wrapper textarea { border: 0; }
|
||||
|
||||
|
||||
/* Caution! Ensure accessibility in print and other media types... */
|
||||
@media projection, screen { /* Use class for showing/hiding tab content, so that visibility can be better controlled in different media types... */
|
||||
.ui-tabs-hide {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Hide useless elements in print layouts... */
|
||||
@media print {
|
||||
.ui-tabs-nav {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Skin */
|
||||
.ui-tabs-nav, .ui-tabs-panel {
|
||||
|
||||
font-size: 12px;
|
||||
}
|
||||
.ui-tabs-nav {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0 0 0 3px;
|
||||
}
|
||||
.ui-tabs-nav:after { /* clearing without presentational markup, IE gets extra treatment */
|
||||
display: block;
|
||||
clear: both;
|
||||
content: " ";
|
||||
}
|
||||
.ui-tabs-nav li {
|
||||
float: left;
|
||||
margin: 0 0 0 2px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.ui-tabs-nav a, .ui-tabs-nav a span {
|
||||
float: left; /* fixes dir=ltr problem and other quirks IE */
|
||||
padding: 0 12px;
|
||||
background: url(../images/embed_code_tabs.gif) no-repeat;
|
||||
}
|
||||
.ui-tabs-nav a {
|
||||
margin: 5px 0 0; /* position: relative makes opacity fail for disabled tab in IE */
|
||||
padding-left: 0;
|
||||
background-position: 100% 0;
|
||||
text-decoration: none;
|
||||
white-space: nowrap; /* @ IE 6 */
|
||||
outline: 0; /* @ Firefox, prevent dotted border after click */
|
||||
}
|
||||
.ui-tabs-nav a:link, .ui-tabs-nav a:visited {
|
||||
color: #fff;
|
||||
}
|
||||
.ui-tabs-nav .ui-tabs-selected a {
|
||||
position: relative;
|
||||
top: 1px;
|
||||
z-index: 2;
|
||||
margin-top: 0;
|
||||
background-position: 100% -23px;
|
||||
}
|
||||
.ui-tabs-nav a span {
|
||||
padding-top: 1px;
|
||||
padding-right: 0;
|
||||
height: 20px;
|
||||
background-position: 0 0;
|
||||
line-height: 20px;
|
||||
}
|
||||
.ui-tabs-nav .ui-tabs-selected a span {
|
||||
padding-top: 0;
|
||||
height: 27px;
|
||||
background-position: 0 -23px;
|
||||
line-height: 27px;
|
||||
}
|
||||
.ui-tabs-nav .ui-tabs-selected a:link, .ui-tabs-nav .ui-tabs-selected a:visited,
|
||||
.ui-tabs-nav .ui-tabs-disabled a:link, .ui-tabs-nav .ui-tabs-disabled a:visited { /* @ Opera, use pseudo classes otherwise it confuses cursor... */
|
||||
cursor: text;
|
||||
}
|
||||
.ui-tabs-nav a:hover, .ui-tabs-nav a:focus, .ui-tabs-nav a:active,
|
||||
.ui-tabs-nav .ui-tabs-unselect a:hover, .ui-tabs-nav .ui-tabs-unselect a:focus, .ui-tabs-nav .ui-tabs-unselect a:active { /* @ Opera, we need to be explicit again here now... */
|
||||
cursor: pointer;
|
||||
}
|
||||
.ui-tabs-disabled {
|
||||
opacity: .4;
|
||||
filter: alpha(opacity=40);
|
||||
}
|
||||
.ui-tabs-nav .ui-tabs-disabled a:link, .ui-tabs-nav .ui-tabs-disabled a:visited {
|
||||
color: #000;
|
||||
}
|
||||
.ui-tabs-panel {
|
||||
padding: 10px;
|
||||
padding-left: 5px;
|
||||
background: #fff; /* declare background color for container to avoid distorted fonts in IE while fading */
|
||||
}
|
||||
/*.ui-tabs-loading em {
|
||||
padding: 0 0 0 20px;
|
||||
background: url(loading.gif) no-repeat 0 50%;
|
||||
}*/
|
||||
|
||||
/* Additional IE specific bug fixes... */
|
||||
* html .ui-tabs-nav { /* auto clear @ IE 6 & IE 7 Quirks Mode */
|
||||
display: inline-block;
|
||||
}
|
||||
*:first-child+html .ui-tabs-nav { /* auto clear @ IE 7 Standards Mode - do not group selectors, otherwise IE 6 will ignore complete rule (because of the unknown + combinator)... */
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
16
data/.htaccess
Normal file
@ -0,0 +1,16 @@
|
||||
# no access to .htaccess
|
||||
<Files .htaccess>
|
||||
order allow,deny
|
||||
deny from all
|
||||
</Files>
|
||||
|
||||
# view.css is required by public visitors
|
||||
<Files view.css>
|
||||
allow from all
|
||||
</Files>
|
||||
|
||||
# limit public access
|
||||
<Limit GET POST PUT>
|
||||
order deny,allow
|
||||
deny from all
|
||||
</Limit>
|
||||
118
delete_element.php
Normal file
@ -0,0 +1,118 @@
|
||||
<?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');
|
||||
require('includes/db-functions.php');
|
||||
|
||||
$form_id = (int) trim($_POST['form_id']);
|
||||
$element_id = (int) trim($_POST['element_id']);
|
||||
|
||||
connect_db();
|
||||
|
||||
if(empty($form_id) || empty($element_id)){
|
||||
die('{ "status" : "error", "message" : "invalid parameter" }');
|
||||
}
|
||||
|
||||
//get type of this element
|
||||
$query = "select element_type from `ap_form_elements` where form_id='$form_id' and element_id='$element_id'";
|
||||
$result = do_query($query);
|
||||
$row = do_fetch_result($result);
|
||||
$element_type = $row['element_type'];
|
||||
$col_prefs = array();
|
||||
|
||||
//delete actual field on respective table data
|
||||
if('address' == $element_type){
|
||||
$query = "ALTER TABLE `ap_form_{$form_id}` DROP COLUMN `element_{$element_id}_1`,DROP COLUMN `element_{$element_id}_2`, DROP COLUMN `element_{$element_id}_3`, DROP COLUMN `element_{$element_id}_4`, DROP COLUMN `element_{$element_id}_5`, DROP COLUMN `element_{$element_id}_6`;";
|
||||
do_query($query);
|
||||
|
||||
$col_prefs = array("element_{$element_id}_1","element_{$element_id}_2","element_{$element_id}_3","element_{$element_id}_4","element_{$element_id}_5","element_{$element_id}_6");
|
||||
}elseif ('simple_name' == $element_type){
|
||||
$query = "ALTER TABLE `ap_form_{$form_id}` DROP COLUMN `element_{$element_id}_1`,DROP COLUMN `element_{$element_id}_2`;";
|
||||
do_query($query);
|
||||
|
||||
$col_prefs = array("element_{$element_id}_1","element_{$element_id}_2");
|
||||
}elseif ('name' == $element_type){
|
||||
$query = "ALTER TABLE `ap_form_{$form_id}` DROP COLUMN `element_{$element_id}_1`,DROP COLUMN `element_{$element_id}_2`, DROP COLUMN `element_{$element_id}_3`, DROP COLUMN `element_{$element_id}_4`;";
|
||||
do_query($query);
|
||||
|
||||
$col_prefs = array("element_{$element_id}_1","element_{$element_id}_2","element_{$element_id}_3","element_{$element_id}_4");
|
||||
}elseif ('checkbox' == $element_type){
|
||||
|
||||
//get option_id list
|
||||
$query = "select option_id from ap_element_options where form_id='{$form_id}' and element_id='{$element_id}' and live=1";
|
||||
$result = do_query($query);
|
||||
|
||||
$option_id_array = array();
|
||||
while($row = do_fetch_result($result)){
|
||||
$option_id_array[] = $row['option_id'];
|
||||
}
|
||||
|
||||
//delete each option
|
||||
$query = "ALTER TABLE `ap_form_{$form_id}` ";
|
||||
foreach ($option_id_array as $option_id){
|
||||
$query .= " DROP COLUMN `element_{$element_id}_{$option_id}`,";
|
||||
$col_prefs[] = "element_{$element_id}_{$option_id}";
|
||||
}
|
||||
|
||||
$query = rtrim($query,',');
|
||||
do_query($query);
|
||||
|
||||
}elseif ('section' == $element_type){
|
||||
//do nothing for section break
|
||||
}elseif ('file' == $element_type){
|
||||
//delete the files first
|
||||
$query = "select element_{$element_id} from `ap_form_{$form_id}`";
|
||||
$result = do_query($query);
|
||||
while($row = do_fetch_result($result)){
|
||||
$filename = $row['element_'.$element_id];
|
||||
@unlink(UPLOAD_DIR."/form_{$form_id}/files/".$filename);
|
||||
}
|
||||
|
||||
$query = "ALTER TABLE `ap_form_{$form_id}` DROP COLUMN `element_{$element_id}`;";
|
||||
do_query($query);
|
||||
|
||||
$col_prefs = array("element_{$element_id}");
|
||||
}else{
|
||||
$query = "ALTER TABLE `ap_form_{$form_id}` DROP COLUMN `element_{$element_id}`;";
|
||||
do_query($query);
|
||||
|
||||
$col_prefs = array("element_{$element_id}");
|
||||
}
|
||||
|
||||
|
||||
//delete on table ap_element_options
|
||||
$query = "delete from `ap_element_options` where form_id='$form_id' and element_id='$element_id'";
|
||||
do_query($query);
|
||||
|
||||
//delete on table ap_form_elements
|
||||
$query = "delete from `ap_form_elements` where form_id='$form_id' and element_id='$element_id'";
|
||||
do_query($query);
|
||||
|
||||
//delete on table ap_column_preferences
|
||||
if(!empty($col_prefs)){
|
||||
foreach ($col_prefs as $element_name){
|
||||
do_query("delete from `ap_column_preferences` where form_id='{$form_id}' and element_name='{$element_name}'");
|
||||
}
|
||||
}
|
||||
|
||||
//if there is no more elements on the table, we need to clear all default fields (id,date_created,date_updated,ip_address)
|
||||
$query = "select * from `ap_form_{$form_id}` limit 1";
|
||||
$result = do_query($query);
|
||||
if(mysql_num_fields($result) <= 4){
|
||||
$query = "truncate `ap_form_{$form_id}`";
|
||||
do_query($query);
|
||||
}
|
||||
|
||||
echo '{ "status" : "ok", "message" : "ok" }';
|
||||
?>
|
||||
50
delete_element_option.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?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');
|
||||
require('includes/db-functions.php');
|
||||
|
||||
$form_id = (int) trim($_POST['form_id']);
|
||||
$element_id = (int) trim($_POST['element_id']);
|
||||
$option_id = (int) trim($_POST['option_id']);
|
||||
|
||||
connect_db();
|
||||
|
||||
if(empty($form_id) || empty($element_id) || empty($option_id)){
|
||||
die('{ "status" : "error", "message" : "invalid parameter" }');
|
||||
}
|
||||
|
||||
//get option info, if checkbox, we need to update element_total_child on ap_form_elements
|
||||
$query = "select element_type from `ap_form_elements` where form_id='$form_id' and element_id='$element_id'";
|
||||
$result = do_query($query);
|
||||
$row = do_fetch_result($result);
|
||||
|
||||
if($row['element_type'] == 'checkbox'){
|
||||
//update 'element_total_child' on ap_form_elements
|
||||
do_query("update ap_form_elements set element_total_child=element_total_child-1 where form_id='$form_id' and element_id='$element_id'");
|
||||
}
|
||||
|
||||
|
||||
//delete on table ap_element_options
|
||||
$query = "delete from `ap_element_options` where form_id='$form_id' and element_id='$element_id' and option_id='$option_id'";
|
||||
do_query($query);
|
||||
|
||||
//delete actual column on table
|
||||
$query = "ALTER TABLE `ap_form_{$form_id}` DROP COLUMN `element_{$element_id}_{$option_id}`;";
|
||||
do_query($query);
|
||||
|
||||
//delete on table ap_column_preferences
|
||||
do_query("delete from `ap_column_preferences` where form_id='{$form_id}' and element_name='element_{$element_id}_{$option_id}'");
|
||||
|
||||
echo '{ "status" : "ok", "message" : "ok" }';
|
||||
?>
|
||||
141
download.php
Normal file
@ -0,0 +1,141 @@
|
||||
<?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');
|
||||
|
||||
connect_db();
|
||||
|
||||
//get query string and parse it, query string is base64 encoded
|
||||
$query_string = trim($_GET['q']);
|
||||
parse_str(base64_decode($query_string),$params);
|
||||
|
||||
$form_id = $params['form_id'];
|
||||
$id = $params['id'];
|
||||
$field_name = $params['el'];
|
||||
|
||||
//get filename
|
||||
$query = "select {$field_name} from `ap_form_{$form_id}` where id='$id'";
|
||||
$result = mysql_query($query);
|
||||
$row = @do_fetch_result($result);
|
||||
$filename_only = $row[$field_name];
|
||||
|
||||
//remove the element_x-xx- suffix we added to all uploaded files
|
||||
$file_1 = substr($filename_only,strpos($filename_only,'-')+1);
|
||||
$filename_only = substr($file_1,strpos($file_1,'-')+1);
|
||||
|
||||
|
||||
$target_file = UPLOAD_DIR."/form_{$form_id}/files/{$row[$field_name]}";
|
||||
|
||||
if(file_exists($target_file)){
|
||||
//prompt user to download the file
|
||||
|
||||
// Get extension of requested file
|
||||
$extension = strtolower(substr(strrchr($filename_only, "."), 1));
|
||||
|
||||
// Determine correct MIME type
|
||||
switch($extension){
|
||||
case "asf": $type = "video/x-ms-asf"; break;
|
||||
case "avi": $type = "video/x-msvideo"; break;
|
||||
case "bin": $type = "application/octet-stream"; break;
|
||||
case "bmp": $type = "image/bmp"; break;
|
||||
case "cgi": $type = "magnus-internal/cgi"; break;
|
||||
case "css": $type = "text/css"; break;
|
||||
case "dcr": $type = "application/x-director"; break;
|
||||
case "dxr": $type = "application/x-director"; break;
|
||||
case "dll": $type = "application/octet-stream"; break;
|
||||
case "doc": $type = "application/msword"; break;
|
||||
case "exe": $type = "application/octet-stream"; break;
|
||||
case "gif": $type = "image/gif"; break;
|
||||
case "gtar": $type = "application/x-gtar"; break;
|
||||
case "gz": $type = "application/gzip"; break;
|
||||
case "htm": $type = "text/html"; break;
|
||||
case "html": $type = "text/html"; break;
|
||||
case "iso": $type = "application/octet-stream"; break;
|
||||
case "jar": $type = "application/java-archive"; break;
|
||||
case "java": $type = "text/x-java-source"; break;
|
||||
case "jnlp": $type = "application/x-java-jnlp-file"; break;
|
||||
case "js": $type = "application/x-javascript"; break;
|
||||
case "jpg": $type = "image/jpg"; break;
|
||||
case "jpe": $type = "image/jpg"; break;
|
||||
case "jpeg": $type = "image/jpg"; break;
|
||||
case "lzh": $type = "application/octet-stream"; break;
|
||||
case "mdb": $type = "application/mdb"; break;
|
||||
case "mid": $type = "audio/x-midi"; break;
|
||||
case "midi": $type = "audio/x-midi"; break;
|
||||
case "mov": $type = "video/quicktime"; break;
|
||||
case "mp2": $type = "audio/x-mpeg"; break;
|
||||
case "mp3": $type = "audio/mpeg"; break;
|
||||
case "mpg": $type = "video/mpeg"; break;
|
||||
case "mpe": $type = "video/mpeg"; break;
|
||||
case "mpeg": $type = "video/mpeg"; break;
|
||||
case "pdf": $type = "application/pdf"; break;
|
||||
case "php": $type = "application/x-httpd-php"; break;
|
||||
case "php3": $type = "application/x-httpd-php3"; break;
|
||||
case "php4": $type = "application/x-httpd-php"; break;
|
||||
case "png": $type = "image/png"; break;
|
||||
case "ppt": $type = "application/mspowerpoint"; break;
|
||||
case "qt": $type = "video/quicktime"; break;
|
||||
case "qti": $type = "image/x-quicktime"; break;
|
||||
case "rar": $type = "encoding/x-compress"; break;
|
||||
case "ra": $type = "audio/x-pn-realaudio"; break;
|
||||
case "rm": $type = "audio/x-pn-realaudio"; break;
|
||||
case "ram": $type = "audio/x-pn-realaudio"; break;
|
||||
case "rtf": $type = "application/rtf"; break;
|
||||
case "swa": $type = "application/x-director"; break;
|
||||
case "swf": $type = "application/x-shockwave-flash"; break;
|
||||
case "tar": $type = "application/x-tar"; break;
|
||||
case "tgz": $type = "application/gzip"; break;
|
||||
case "tif": $type = "image/tiff"; break;
|
||||
case "tiff": $type = "image/tiff"; break;
|
||||
case "torrent": $type = "application/x-bittorrent"; break;
|
||||
case "txt": $type = "text/plain"; break;
|
||||
case "wav": $type = "audio/wav"; break;
|
||||
case "wma": $type = "audio/x-ms-wma"; break;
|
||||
case "wmv": $type = "video/x-ms-wmv"; break;
|
||||
case "xls": $type = "application/vnd.ms-excel"; break;
|
||||
case "xml": $type = "application/xml"; break;
|
||||
case "7z": $type = "application/x-compress"; break;
|
||||
case "zip": $type = "application/x-zip-compressed"; break;
|
||||
default: $type = "application/force-download"; break;
|
||||
}
|
||||
|
||||
// Fix IE bug [0]
|
||||
$header_file = (strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE')) ? preg_replace('/\./', '%2e', $filename_only, substr_count($filename_only, '.') - 1) : $filename_only;
|
||||
|
||||
//Prepare headers
|
||||
header("Pragma: public");
|
||||
header("Expires: 0");
|
||||
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
|
||||
header("Cache-Control: public", false);
|
||||
header("Content-Description: File Transfer");
|
||||
header("Content-Type: " . $type);
|
||||
header("Accept-Ranges: bytes");
|
||||
header("Content-Disposition: attachment; filename=\"" . $header_file . "\"");
|
||||
header("Content-Transfer-Encoding: binary");
|
||||
header("Content-Length: " . filesize($target_file));
|
||||
|
||||
|
||||
// Send file for download
|
||||
if ($stream = fopen($target_file, 'rb')){
|
||||
while(!feof($stream) && connection_status() == 0){
|
||||
//reset time limit for big files
|
||||
set_time_limit(0);
|
||||
print(fread($stream,1024*8));
|
||||
flush();
|
||||
}
|
||||
fclose($stream);
|
||||
}
|
||||
}else{
|
||||
echo 'File not found!';
|
||||
}
|
||||
?>
|
||||
82
edit_css.php
Normal file
@ -0,0 +1,82 @@
|
||||
<?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');
|
||||
require('includes/db-functions.php');
|
||||
require('includes/helper-functions.php');
|
||||
require('lib/pear/Compat/Function/file_put_contents.php');
|
||||
|
||||
connect_db();
|
||||
|
||||
$form_id = (int) trim($_REQUEST['id']);
|
||||
$css_filename = DATA_DIR."/form_{$form_id}/css/view.css";
|
||||
|
||||
|
||||
//handle form submit
|
||||
if(!empty($_POST['submit'])){
|
||||
//save to file and redirect to manage_entries
|
||||
$css_content = stripslashes($_POST['css_data']);
|
||||
if(is_writable($css_filename)){
|
||||
$_SESSION['AP_SUCCESS']['title'] = 'Success';
|
||||
$_SESSION['AP_SUCCESS']['desc'] = 'CSS file successfully updated.';
|
||||
|
||||
file_put_contents($css_filename,$css_content);
|
||||
header("Location: manage_form.php?id={$form_id}");
|
||||
exit;
|
||||
}else{
|
||||
|
||||
$_SESSION['AP_ERROR']['title'] = 'An error occured while saving';
|
||||
$_SESSION['AP_ERROR']['desc'] = 'Unable to write into CSS file. Please check your file permission.';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//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'];
|
||||
|
||||
$css_content = htmlspecialchars(file_get_contents($css_filename),ENT_QUOTES);
|
||||
|
||||
?>
|
||||
|
||||
<?php require('includes/header.php'); ?>
|
||||
|
||||
<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" /> CSS File</h2>
|
||||
<p>Editing <b><?php echo $css_filename; ?></b></p>
|
||||
</div>
|
||||
|
||||
<div id="form_container">
|
||||
<form id="form_edit_css" class="appnitro" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
|
||||
<ul>
|
||||
<li class="highlighted">
|
||||
<label class="desc" for="css_data">File Content</label>
|
||||
<div>
|
||||
<textarea id="css_data" name="css_data" class="element textarea large"><?php echo $css_content; ?></textarea>
|
||||
</div>
|
||||
</li>
|
||||
<li class="buttons">
|
||||
<input type="hidden" name="id" value="<?php echo $form_id; ?>" />
|
||||
<input id="saveForm" class="button_text" type="submit" name="submit" value="Update File" />
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
</div><br />
|
||||
|
||||
</div>
|
||||
<?php require('includes/footer.php'); ?>
|
||||
837
edit_entry.css
Normal file
@ -0,0 +1,837 @@
|
||||
#main_body
|
||||
{
|
||||
background:#fffff;
|
||||
font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
|
||||
font-size:small;
|
||||
margin:8px 0 16px;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
#form_container
|
||||
{
|
||||
background:#fff;
|
||||
border:1px solid #ccc;
|
||||
margin:0 auto;
|
||||
text-align:left;
|
||||
width:640px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
form.appnitro
|
||||
{
|
||||
margin:20px 20px 0;
|
||||
padding:0 0 20px;
|
||||
}
|
||||
|
||||
/**** Logo Section *****/
|
||||
#main_body h1
|
||||
{
|
||||
background-color:#dedede;
|
||||
margin:0;
|
||||
min-height:0;
|
||||
padding:0;
|
||||
text-decoration:none;
|
||||
text-indent:-8000px;
|
||||
background-image: url('../../../images/machform.gif');
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
#main_body h1 a
|
||||
{
|
||||
|
||||
display:block;
|
||||
height:100%;
|
||||
min-height:40px;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
|
||||
#main_body img
|
||||
{
|
||||
behavior:url(css/iepngfix.htc);
|
||||
border:none;
|
||||
}
|
||||
|
||||
|
||||
/**** Form Section ****/
|
||||
.appnitro
|
||||
{
|
||||
font-family:Lucida Grande, Tahoma, Arial, Verdana, sans-serif;
|
||||
font-size:small;
|
||||
}
|
||||
|
||||
.appnitro li
|
||||
{
|
||||
width:61%;
|
||||
}
|
||||
|
||||
#main_body form ul
|
||||
{
|
||||
font-size:100%;
|
||||
list-style-type:none;
|
||||
margin:0;
|
||||
padding:0;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
#main_body form li
|
||||
{
|
||||
display:block;
|
||||
margin:0;
|
||||
padding:4px 5px 2px 9px;
|
||||
position:relative;
|
||||
}
|
||||
|
||||
#main_body form li:after
|
||||
{
|
||||
clear:both;
|
||||
content:".";
|
||||
display:block;
|
||||
height:0;
|
||||
visibility:hidden;
|
||||
}
|
||||
|
||||
#main_body .buttons:after
|
||||
{
|
||||
clear:both;
|
||||
content:".";
|
||||
display:block;
|
||||
height:0;
|
||||
visibility:hidden;
|
||||
}
|
||||
|
||||
#main_body .buttons
|
||||
{
|
||||
clear:both;
|
||||
display:block;
|
||||
margin-top:10px;
|
||||
}
|
||||
|
||||
#main_body html form li div
|
||||
{
|
||||
display:inline-block;
|
||||
}
|
||||
|
||||
#main_body form li div
|
||||
{
|
||||
color:#444;
|
||||
margin:0 4px 0 0;
|
||||
padding:0 0 8px;
|
||||
}
|
||||
|
||||
#main_body form li span
|
||||
{
|
||||
color:#444;
|
||||
float:left;
|
||||
margin:0 4px 0 0;
|
||||
padding:0 0 8px;
|
||||
}
|
||||
|
||||
#main_body form li div.left
|
||||
{
|
||||
display:inline;
|
||||
float:left;
|
||||
width:48%;
|
||||
}
|
||||
|
||||
#main_body form li div.right
|
||||
{
|
||||
display:inline;
|
||||
float:right;
|
||||
width:48%;
|
||||
}
|
||||
|
||||
#main_body form li div.left .medium
|
||||
{
|
||||
width:100%;
|
||||
}
|
||||
|
||||
#main_body form li div.right .medium
|
||||
{
|
||||
width:100%;
|
||||
}
|
||||
|
||||
#main_body .clear
|
||||
{
|
||||
clear:both;
|
||||
}
|
||||
|
||||
#main_body form li div label
|
||||
{
|
||||
clear:both;
|
||||
color:#444;
|
||||
display:block;
|
||||
font-size:9px;
|
||||
line-height:9px;
|
||||
margin:0;
|
||||
padding-top:3px;
|
||||
}
|
||||
|
||||
#main_body form li span label
|
||||
{
|
||||
clear:both;
|
||||
color:#444;
|
||||
display:block;
|
||||
font-size:9px;
|
||||
line-height:9px;
|
||||
margin:0;
|
||||
padding-top:3px;
|
||||
}
|
||||
|
||||
#main_body form li .datepicker
|
||||
{
|
||||
cursor:pointer !important;
|
||||
float:left;
|
||||
height:16px;
|
||||
margin:.1em 5px 0 0;
|
||||
padding:0;
|
||||
width:16px;
|
||||
}
|
||||
|
||||
#main_body .form_description
|
||||
{
|
||||
|
||||
display: none;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#main_body form hr
|
||||
{
|
||||
display:none;
|
||||
}
|
||||
|
||||
#main_body form li.section_break
|
||||
{
|
||||
border-top:1px dotted #ccc;
|
||||
margin-top:9px;
|
||||
padding-bottom:0;
|
||||
padding-left:9px;
|
||||
padding-top:13px;
|
||||
width:97% !important;
|
||||
}
|
||||
|
||||
#main_body form ul li.first
|
||||
{
|
||||
border-top:none !important;
|
||||
margin-top:0 !important;
|
||||
padding-top:0 !important;
|
||||
}
|
||||
|
||||
#main_body form .section_break h3
|
||||
{
|
||||
font-size:110%;
|
||||
font-weight:400;
|
||||
line-height:130%;
|
||||
margin:0 0 2px;
|
||||
}
|
||||
|
||||
#main_body form .section_break p
|
||||
{
|
||||
font-size:85%;
|
||||
|
||||
margin:0 0 10px;
|
||||
}
|
||||
|
||||
/**** Buttons ****/
|
||||
#main_body input.button_text
|
||||
{
|
||||
overflow:visible;
|
||||
padding:0 7px;
|
||||
width:auto;
|
||||
}
|
||||
|
||||
#main_body .buttons input
|
||||
{
|
||||
font-size:110%;
|
||||
margin-right:5px;
|
||||
font-family: "Lucida Grande",Tahoma,Arial,Verdana,sans-serif;
|
||||
}
|
||||
|
||||
/**** Inputs and Labels ****/
|
||||
#main_body label.description
|
||||
{
|
||||
border:none;
|
||||
color:#222;
|
||||
display:block;
|
||||
font-size:95%;
|
||||
font-weight:700;
|
||||
line-height:150%;
|
||||
padding:0 0 1px;
|
||||
}
|
||||
|
||||
#main_body span.symbol
|
||||
{
|
||||
font-size:115%;
|
||||
line-height:130%;
|
||||
}
|
||||
|
||||
#main_body input.text
|
||||
{
|
||||
background:#fff url(images/shadow.gif) repeat-x top;
|
||||
border-bottom:1px solid #ddd;
|
||||
border-left:1px solid #c3c3c3;
|
||||
border-right:1px solid #c3c3c3;
|
||||
border-top:1px solid #7c7c7c;
|
||||
color:#333;
|
||||
font-size:100%;
|
||||
margin:0;
|
||||
padding:2px 0;
|
||||
}
|
||||
|
||||
#main_body input.file
|
||||
{
|
||||
color:#333;
|
||||
font-size:100%;
|
||||
margin:0;
|
||||
padding:2px 0;
|
||||
}
|
||||
|
||||
#main_body textarea.textarea
|
||||
{
|
||||
background:#fff url(../../../images/shadow.gif) repeat-x top;
|
||||
border-bottom:1px solid #ddd;
|
||||
border-left:1px solid #c3c3c3;
|
||||
border-right:1px solid #c3c3c3;
|
||||
border-top:1px solid #7c7c7c;
|
||||
color:#333;
|
||||
font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
|
||||
font-size:100%;
|
||||
margin:0;
|
||||
width:99%;
|
||||
}
|
||||
|
||||
#main_body select.select
|
||||
{
|
||||
color:#333;
|
||||
font-size:100%;
|
||||
margin:1px 0;
|
||||
padding:1px 0 0;
|
||||
background:#fff url(../../../images/shadow.gif) repeat-x top;
|
||||
border-bottom:1px solid #ddd;
|
||||
border-left:1px solid #c3c3c3;
|
||||
border-right:1px solid #c3c3c3;
|
||||
border-top:1px solid #7c7c7c;
|
||||
}
|
||||
|
||||
|
||||
#main_body input.currency
|
||||
{
|
||||
text-align:right;
|
||||
}
|
||||
|
||||
#main_body input.checkbox
|
||||
{
|
||||
display:block;
|
||||
height:13px;
|
||||
line-height:1.4em;
|
||||
margin:6px 0 0 3px;
|
||||
width:13px;
|
||||
}
|
||||
|
||||
#main_body input.radio
|
||||
{
|
||||
display:block;
|
||||
height:13px;
|
||||
line-height:1.4em;
|
||||
margin:6px 0 0 3px;
|
||||
width:13px;
|
||||
}
|
||||
|
||||
#main_body label.choice
|
||||
{
|
||||
color:#444;
|
||||
display:block;
|
||||
font-size:100%;
|
||||
line-height:1.4em;
|
||||
margin:-1.55em 0 0 25px;
|
||||
padding:4px 0 5px;
|
||||
width:90%;
|
||||
}
|
||||
|
||||
#main_body select.select[class]
|
||||
{
|
||||
margin:0;
|
||||
padding:1px 0;
|
||||
}
|
||||
|
||||
*:first-child+html select.select[class]
|
||||
{
|
||||
margin:1px 0;
|
||||
}
|
||||
|
||||
#main_body .safari select.select
|
||||
{
|
||||
font-size:120% !important;
|
||||
margin-bottom:1px;
|
||||
}
|
||||
|
||||
#main_body input.small
|
||||
{
|
||||
width:25%;
|
||||
}
|
||||
|
||||
#main_body select.small
|
||||
{
|
||||
width:25%;
|
||||
}
|
||||
|
||||
#main_body input.medium
|
||||
{
|
||||
width:50%;
|
||||
}
|
||||
|
||||
#main_body select.medium
|
||||
{
|
||||
width:50%;
|
||||
}
|
||||
|
||||
#main_body input.large
|
||||
{
|
||||
width:99%;
|
||||
}
|
||||
|
||||
#main_body select.large
|
||||
{
|
||||
width:100%;
|
||||
}
|
||||
|
||||
#main_body textarea.small
|
||||
{
|
||||
height:5.5em;
|
||||
}
|
||||
|
||||
#main_body textarea.medium
|
||||
{
|
||||
height:10em;
|
||||
}
|
||||
|
||||
#main_body textarea.large
|
||||
{
|
||||
height:20em;
|
||||
}
|
||||
|
||||
/**** Errors ****/
|
||||
#error_message
|
||||
{
|
||||
background:#fff;
|
||||
border:1px dotted red;
|
||||
margin-bottom:1em;
|
||||
padding-left:0;
|
||||
padding-right:0;
|
||||
padding-top:4px;
|
||||
text-align:center;
|
||||
width:97%;
|
||||
}
|
||||
|
||||
#error_message_title
|
||||
{
|
||||
color:#DF0000;
|
||||
font-size:125%;
|
||||
margin:7px 0 5px !important;
|
||||
padding:0 !important;
|
||||
}
|
||||
|
||||
#error_message_desc
|
||||
{
|
||||
color:#000;
|
||||
font-size:100%;
|
||||
margin:0 0 .8em !important;
|
||||
}
|
||||
|
||||
#error_message_desc strong
|
||||
{
|
||||
background-color:#FFDFDF;
|
||||
color:red;
|
||||
padding:2px 3px;
|
||||
}
|
||||
|
||||
#main_body form li.error
|
||||
{
|
||||
background-color:#FFDFDF !important;
|
||||
border-bottom:1px solid #EACBCC;
|
||||
border-right:1px solid #EACBCC;
|
||||
margin:3px 0;
|
||||
}
|
||||
|
||||
#main_body form li.error label
|
||||
{
|
||||
color:#DF0000 !important;
|
||||
}
|
||||
|
||||
#main_body form p.error
|
||||
{
|
||||
clear:both;
|
||||
color:red;
|
||||
font-size:10px;
|
||||
font-weight:700;
|
||||
margin:0 0 5px !important;
|
||||
}
|
||||
|
||||
#main_body form .required
|
||||
{
|
||||
color:red !important;
|
||||
float:none !important;
|
||||
font-weight:700;
|
||||
}
|
||||
|
||||
/**** Guidelines and Error Highlight ****/
|
||||
#main_body form li.highlighted
|
||||
{
|
||||
background-color:#fff7c0;
|
||||
}
|
||||
|
||||
#main_body form .guidelines
|
||||
{
|
||||
background:#f5f5f5;
|
||||
border:1px solid #e6e6e6;
|
||||
color:#444;
|
||||
font-size:80%;
|
||||
left:100%;
|
||||
line-height:130%;
|
||||
margin:0 0 0 8px !important;
|
||||
padding:8px 10px 9px;
|
||||
position:absolute;
|
||||
top:0;
|
||||
visibility:hidden;
|
||||
width:42%;
|
||||
z-index:1000;
|
||||
}
|
||||
|
||||
#main_body form .guidelines small
|
||||
{
|
||||
font-size:105%;
|
||||
}
|
||||
|
||||
#main_body form li.highlighted .guidelines
|
||||
{
|
||||
visibility:visible;
|
||||
}
|
||||
|
||||
#main_body form li:hover .guidelines
|
||||
{
|
||||
visibility:visible;
|
||||
}
|
||||
|
||||
.no_guidelines .guidelines
|
||||
{
|
||||
display:none !important;
|
||||
}
|
||||
|
||||
.no_guidelines form li
|
||||
{
|
||||
width:97%;
|
||||
}
|
||||
|
||||
.no_guidelines li.section
|
||||
{
|
||||
padding-left:9px;
|
||||
}
|
||||
|
||||
/*** Success Message ****/
|
||||
.form_success
|
||||
{
|
||||
clear: both;
|
||||
margin: 0;
|
||||
padding: 90px 0pt 100px;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
.form_success h2 {
|
||||
clear:left;
|
||||
font-size:160%;
|
||||
font-weight:normal;
|
||||
margin:0pt 0pt 3px;
|
||||
}
|
||||
|
||||
/*** Password ****/
|
||||
#main_body ul.password{
|
||||
margin-top:60px;
|
||||
margin-bottom: 60px;
|
||||
text-align: center;
|
||||
}
|
||||
.password h2{
|
||||
color:#DF0000;
|
||||
font-weight:bold;
|
||||
margin:0pt auto 10px;
|
||||
}
|
||||
|
||||
.password input.text {
|
||||
font-size:170% !important;
|
||||
width:380px;
|
||||
text-align: center;
|
||||
}
|
||||
.password label{
|
||||
display:block;
|
||||
font-size:120% !important;
|
||||
padding-top:10px;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
#li_captcha{
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
|
||||
#li_captcha span{
|
||||
float:none;
|
||||
padding: 0px !important;
|
||||
}
|
||||
|
||||
#li_captcha div{
|
||||
padding: 0px !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** Integrated Form **/
|
||||
.integrated *{
|
||||
font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.integrated #top, .integrated #bottom, .integrated h1{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.integrated #form_container{
|
||||
border: none;
|
||||
width: 99%;
|
||||
background: none;
|
||||
}
|
||||
|
||||
.integrated #footer{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.integrated #footer.success{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.integrated form.appnitro
|
||||
{
|
||||
margin:0px 0px 0;
|
||||
|
||||
}
|
||||
|
||||
.integrated form .section_break h3
|
||||
{
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.integrated #error_message h3
|
||||
{
|
||||
border: none !important;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*** Calendar **********************/
|
||||
div.calendar { position: relative; }
|
||||
|
||||
|
||||
.calendar table {
|
||||
cursor:pointer;
|
||||
border:1px solid #ccc;
|
||||
font-size: 11px;
|
||||
color: #000;
|
||||
background: #fff;
|
||||
font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
|
||||
}
|
||||
|
||||
.calendar table .title,.calendar table .button{
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.calendar * {
|
||||
font-size: 11px;
|
||||
font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
|
||||
}
|
||||
|
||||
.calendar .button {
|
||||
text-align: center;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.calendar .nav {
|
||||
background:#f5f5f5;
|
||||
}
|
||||
|
||||
.calendar thead .title {
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
background: #dedede;
|
||||
color: #000;
|
||||
padding: 2px 0 3px 0;
|
||||
}
|
||||
|
||||
.calendar thead .headrow {
|
||||
background: #f5f5f5;
|
||||
color: #444;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
.calendar thead .daynames {
|
||||
background: #fff;
|
||||
color:#333;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
.calendar thead .name {
|
||||
border-bottom: 1px dotted #ccc;
|
||||
padding: 2px;
|
||||
text-align: center;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.calendar thead .weekend {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.calendar thead .hilite {
|
||||
background-color: #444;
|
||||
color: #fff;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar thead .active {
|
||||
background-color: #d12f19;
|
||||
color:#fff;
|
||||
padding: 2px 0px 0px 2px;
|
||||
}
|
||||
|
||||
|
||||
.calendar tbody .day {
|
||||
width:1.8em;
|
||||
color: #222;
|
||||
text-align: right;
|
||||
padding: 2px 2px 2px 2px;
|
||||
}
|
||||
.calendar tbody .day.othermonth {
|
||||
font-size: 80%;
|
||||
color: #bbb;
|
||||
}
|
||||
.calendar tbody .day.othermonth.oweekend {
|
||||
color: #fbb;
|
||||
}
|
||||
|
||||
.calendar table .wn {
|
||||
padding: 2px 2px 2px 2px;
|
||||
border-right: 1px solid #000;
|
||||
background: #666;
|
||||
}
|
||||
|
||||
.calendar tbody .rowhilite td {
|
||||
background: #FFF1AF;
|
||||
}
|
||||
|
||||
.calendar tbody .rowhilite td.wn {
|
||||
background: #FFF1AF;
|
||||
}
|
||||
|
||||
.calendar tbody td.hilite {
|
||||
padding: 1px 1px 1px 1px;
|
||||
background:#444 !important;
|
||||
color:#fff !important;
|
||||
}
|
||||
|
||||
.calendar tbody td.active {
|
||||
color:#fff;
|
||||
background: #529214 !important;
|
||||
padding: 2px 2px 0px 2px;
|
||||
}
|
||||
|
||||
.calendar tbody td.selected {
|
||||
font-weight: bold;
|
||||
border: 1px solid #888;
|
||||
padding: 1px 1px 1px 1px;
|
||||
background: #f5f5f5 !important;
|
||||
color: #222 !important;
|
||||
}
|
||||
|
||||
.calendar tbody td.weekend {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.calendar tbody td.today {
|
||||
font-weight: bold;
|
||||
color: #529214;
|
||||
background:#D9EFC2;
|
||||
}
|
||||
|
||||
.calendar tbody .disabled { color: #999; }
|
||||
|
||||
.calendar tbody .emptycell {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.calendar tbody .emptyrow {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.calendar tfoot .footrow {
|
||||
text-align: center;
|
||||
background: #556;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.calendar tfoot .ttip {
|
||||
background: #222;
|
||||
color: #fff;
|
||||
font-size:10px;
|
||||
border-top: 1px solid #dedede;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
.calendar tfoot .hilite {
|
||||
background: #aaf;
|
||||
border: 1px solid #04f;
|
||||
color: #000;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar tfoot .active {
|
||||
background: #77c;
|
||||
padding: 2px 0px 0px 2px;
|
||||
}
|
||||
|
||||
.calendar .combo {
|
||||
position: absolute;
|
||||
display: none;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
width: 4em;
|
||||
border: 1px solid #ccc;
|
||||
background: #f5f5f5;
|
||||
color: #222;
|
||||
font-size: 90%;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.calendar .combo .label,
|
||||
.calendar .combo .label-IEfix {
|
||||
text-align: center;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar .combo .label-IEfix {
|
||||
width: 4em;
|
||||
}
|
||||
|
||||
.calendar .combo .hilite {
|
||||
background: #444;
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
.calendar .combo .active {
|
||||
border-top: 1px solid #999;
|
||||
border-bottom: 1px solid #999;
|
||||
background: #dedede;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
203
edit_entry.php
Normal file
@ -0,0 +1,203 @@
|
||||
<?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/language.php');
|
||||
require('includes/check-session.php');
|
||||
require('includes/db-core.php');
|
||||
require('includes/common-validator.php');
|
||||
require('includes/view-functions.php');
|
||||
require('includes/post-functions.php');
|
||||
require('includes/entry-functions.php');
|
||||
require('includes/filter-functions.php');
|
||||
require('includes/helper-functions.php');
|
||||
|
||||
|
||||
connect_db();
|
||||
|
||||
$form_id = (int) trim($_REQUEST['form_id']);
|
||||
$entry_id = (int) trim($_REQUEST['id']);
|
||||
|
||||
$machform_path = '';
|
||||
|
||||
if(!empty($_POST['submit'])){ //if form submitted
|
||||
$input_array = ap_sanitize_input($_POST);
|
||||
|
||||
$submit_result = process_form_update($input_array);
|
||||
|
||||
if($submit_result['status'] === true){
|
||||
$_SESSION['AP_SUCCESS']['title'] = 'Success';
|
||||
$_SESSION['AP_SUCCESS']['desc'] = "Entry #{$input_array['edit_id']} has been updated.";
|
||||
unset($_SESSION['edit_entry']);
|
||||
|
||||
$ssl_suffix = get_ssl_suffix();
|
||||
header("Location: http{$ssl_suffix}://".$_SERVER['HTTP_HOST'].get_dirname($_SERVER['PHP_SELF'])."/view_entry.php?form_id={$input_array['form_id']}&id={$input_array['edit_id']}");
|
||||
exit;
|
||||
}else{
|
||||
$old_values = $submit_result['old_values'];
|
||||
$custom_error = $submit_result['custom_error'];
|
||||
$error_elements = $submit_result['error_elements'];
|
||||
|
||||
$markup = display_integrated_form($input_array['form_id'],$old_values,$error_elements,$custom_error,$input_array['edit_id'],$machform_path);
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
if(empty($form_id) || empty($entry_id)){
|
||||
die('ID required.');
|
||||
}
|
||||
|
||||
//check for delete parameter
|
||||
if(!empty($_GET['delete'])){
|
||||
|
||||
delete_entries($form_id,array($entry_id));
|
||||
|
||||
$_SESSION['AP_SUCCESS']['title'] = 'Entry deleted';
|
||||
$_SESSION['AP_SUCCESS']['desc'] = "Entry #{$entry_id} has been deleted.";
|
||||
|
||||
$ssl_suffix = get_ssl_suffix();
|
||||
header("Location: http{$ssl_suffix}://".$_SERVER['HTTP_HOST'].get_dirname($_SERVER['PHP_SELF'])."/manage_entries.php?id={$form_id}");
|
||||
exit;
|
||||
}
|
||||
|
||||
//check for delete file option
|
||||
if(!empty($_GET['delete_file'])){
|
||||
$element_id = (int) trim($_GET['delete_file']);
|
||||
delete_file_entry($form_id,$entry_id,$element_id);
|
||||
|
||||
$_SESSION['AP_SUCCESS']['title'] = 'File Deleted';
|
||||
$_SESSION['AP_SUCCESS']['desc'] = "A file has been deleted from this entry.";
|
||||
}
|
||||
|
||||
//set session value to override password protected form and captcha
|
||||
$_SESSION['user_authenticated'] = $form_id;
|
||||
|
||||
//set session value to bypass unique checking
|
||||
$_SESSION['edit_entry']['form_id'] = $form_id;
|
||||
$_SESSION['edit_entry']['entry_id'] = $entry_id;
|
||||
|
||||
|
||||
//get initial form values
|
||||
$form_values = get_entry_values($form_id,$entry_id);
|
||||
|
||||
$markup = display_integrated_form($form_id,$form_values,null,'',$entry_id,$machform_path);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/** Other small stuff queries **/
|
||||
|
||||
//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'];
|
||||
|
||||
|
||||
//get ids for navigation buttons
|
||||
//older entry id
|
||||
$result = do_query("select id from ap_form_{$form_id} where id < $entry_id order by id desc limit 1");
|
||||
$row = do_fetch_result($result);
|
||||
$older_entry_id = $row['id'];
|
||||
|
||||
//oldest entry id
|
||||
$result = do_query("select id from ap_form_{$form_id} order by id asc limit 1");
|
||||
$row = do_fetch_result($result);
|
||||
$oldest_entry_id = $row['id'];
|
||||
|
||||
//newer entry id
|
||||
$result = do_query("select id from ap_form_{$form_id} where id > $entry_id order by id asc limit 1");
|
||||
$row = do_fetch_result($result);
|
||||
$newer_entry_id = $row['id'];
|
||||
|
||||
//newest entry id
|
||||
$result = do_query("select id from ap_form_{$form_id} order by id desc limit 1");
|
||||
$row = do_fetch_result($result);
|
||||
$newest_entry_id = $row['id'];
|
||||
|
||||
if(($entry_id == $newest_entry_id) && ($entry_id == $oldest_entry_id)){
|
||||
$nav_position = 'disabled';
|
||||
}elseif($entry_id == $newest_entry_id){
|
||||
$nav_position = 'newest';
|
||||
}elseif ($entry_id == $oldest_entry_id){
|
||||
$nav_position = 'oldest';
|
||||
}else{
|
||||
$nav_position = 'middle';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php require('includes/header.php'); ?>
|
||||
|
||||
|
||||
<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" /> <a class="breadcrumb" href="manage_entries.php?id=<?php echo $form_id; ?>">Entries</a> <img src="images/icons/resultset_next.gif" align="bottom" /> #<?php echo $entry_id; ?> </h2>
|
||||
<p>Editing entry #<?php echo $entry_id; ?></p>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="edit_entry">
|
||||
<div id="ee_detail" >
|
||||
<?php echo $markup; ?>
|
||||
</div>
|
||||
<?php
|
||||
if($nav_position == 'newest'){
|
||||
$img_new = '_grey';
|
||||
}elseif ($nav_position == 'oldest'){
|
||||
$img_old = '_grey';
|
||||
}elseif ($nav_position == 'disabled'){
|
||||
$img_new = '_grey';
|
||||
$img_old = '_grey';
|
||||
}
|
||||
?>
|
||||
<div id="ee_action_container">
|
||||
<div style="text-align:center;">
|
||||
<?php
|
||||
if(empty($img_new)){
|
||||
?>
|
||||
<a href="edit_entry.php?<?php echo "form_id={$form_id}&id={$newest_entry_id}"; ?>" alt="Newest"><img src="images/icons/nav_start<?php echo $img_new; ?>.gif" title="Newest"/></a>
|
||||
<a href="edit_entry.php?<?php echo "form_id={$form_id}&id={$newer_entry_id}"; ?>" alt="Newer"><img src="images/icons/nav_prev<?php echo $img_new; ?>.gif" title="Newer"/></a>
|
||||
|
||||
<?php }else{ ?>
|
||||
|
||||
<img src="images/icons/nav_start<?php echo $img_new; ?>.gif" title="Newest"/>
|
||||
<img src="images/icons/nav_prev<?php echo $img_new; ?>.gif" title="Newer"/>
|
||||
|
||||
<?php }
|
||||
|
||||
if(empty($img_old)){
|
||||
?>
|
||||
|
||||
<a href="edit_entry.php?<?php echo "form_id={$form_id}&id={$older_entry_id}"; ?>" alt="Older"><img src="images/icons/nav_next<?php echo $img_old; ?>.gif" title="Older"/></a>
|
||||
<a href="edit_entry.php?<?php echo "form_id={$form_id}&id={$oldest_entry_id}"; ?>" alt="Oldest"><img src="images/icons/nav_end<?php echo $img_old; ?>.gif" title="Oldest"/></a>
|
||||
|
||||
<?php } else { ?>
|
||||
<img src="images/icons/nav_next<?php echo $img_old; ?>.gif" title="Older"/>
|
||||
<img src="images/icons/nav_end<?php echo $img_old; ?>.gif" title="Oldest"/>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div style="font-size: 85%;color: #444;margin-top: 25px;padding-bottom: 5px; font-weight: bold">Entry Options</div>
|
||||
<div id="ee_action">
|
||||
<ul style="list-style-type: none;padding: 10px">
|
||||
<li><img src="images/icons/search.gif" align="absmiddle"/> <a href="view_entry.php?form_id=<?php echo $form_id; ?>&id=<?php echo $entry_id; ?>" class="big_dotted_link">View</a></li>
|
||||
<li><img src="images/icons/cross_22.gif" align="absmiddle"/> <a onclick="return confirm('Are you sure you want to delete this entry?');" href="edit_entry.php?form_id=<?php echo $form_id; ?>&id=<?php echo $entry_id; ?>&delete=1" class="big_dotted_link">Delete</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<?php require('includes/footer.php'); ?>
|
||||
721
edit_form.php
Normal file
@ -0,0 +1,721 @@
|
||||
<?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');
|
||||
require('includes/db-functions.php');
|
||||
require('includes/JSON.php');
|
||||
|
||||
if(!empty($_GET['id'])){
|
||||
$form_id = (int) trim($_GET['id']);
|
||||
}else{
|
||||
$form_id = 0;
|
||||
}
|
||||
|
||||
|
||||
//get data from databae
|
||||
connect_db();
|
||||
|
||||
//get form data
|
||||
$query = "select
|
||||
form_name,
|
||||
form_description,
|
||||
form_redirect,
|
||||
form_success_message,
|
||||
form_password,
|
||||
form_unique_ip,
|
||||
form_captcha,
|
||||
form_review,
|
||||
form_frame_height
|
||||
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;
|
||||
$form->name = $row['form_name'];
|
||||
$form->description = $row['form_description'];
|
||||
$form->redirect = $row['form_redirect'];
|
||||
$form->success_message = $row['form_success_message'];
|
||||
$form->password = $row['form_password'];
|
||||
$form->frame_height = $row['form_frame_height'];
|
||||
$form->unique_ip = $row['form_unique_ip'];
|
||||
$form->captcha = $row['form_captcha'];
|
||||
$form->review = $row['form_review'];
|
||||
}else{
|
||||
$form->id = 0;
|
||||
$form->name = 'Untitled Form';
|
||||
$form->description = 'This is your form description. Click here to edit.';
|
||||
$form->redirect = '';
|
||||
$form->success_message = 'Success! Your submission has been saved!';
|
||||
$form->password = '';
|
||||
$form->frame_height = 0;
|
||||
$form->unique_ip = 0;
|
||||
$form->captcha = 0;
|
||||
$form->review = 0;
|
||||
}
|
||||
|
||||
//get element options first and store it into array
|
||||
$query = "select
|
||||
element_id,
|
||||
option_id,
|
||||
`position`,
|
||||
`option`,
|
||||
option_is_default
|
||||
from
|
||||
ap_element_options
|
||||
where
|
||||
form_id='$form_id' and live=1
|
||||
order by
|
||||
element_id asc,`position` asc";
|
||||
$result = do_query($query);
|
||||
while($row = do_fetch_result($result)){
|
||||
$element_id = $row['element_id'];
|
||||
$option_id = $row['option_id'];
|
||||
$options_lookup[$element_id][$option_id]['position'] = $row['position'];
|
||||
$options_lookup[$element_id][$option_id]['option'] = $row['option'];
|
||||
$options_lookup[$element_id][$option_id]['option_is_default'] = $row['option_is_default'];
|
||||
}
|
||||
|
||||
|
||||
//get elements data
|
||||
$element = array();
|
||||
$query = "select
|
||||
element_id,
|
||||
element_title,
|
||||
element_guidelines,
|
||||
element_size,
|
||||
element_is_required,
|
||||
element_is_unique,
|
||||
element_is_private,
|
||||
element_type,
|
||||
element_position,
|
||||
element_default_value,
|
||||
element_constraint
|
||||
from
|
||||
ap_form_elements
|
||||
where
|
||||
form_id='$form_id'
|
||||
order by
|
||||
element_position asc";
|
||||
$result = do_query($query);
|
||||
$j=0;
|
||||
while($row = do_fetch_result($result)){
|
||||
$element_id = $row['element_id'];
|
||||
|
||||
//lookup element options first
|
||||
if(!empty($options_lookup[$element_id])){
|
||||
$element_options = array();
|
||||
$i=0;
|
||||
foreach ($options_lookup[$element_id] as $option_id=>$data){
|
||||
$element_options[$i] = new stdClass();
|
||||
$element_options[$i]->id = $option_id;
|
||||
$element_options[$i]->option = $data['option'];
|
||||
$element_options[$i]->is_default = $data['option_is_default'];
|
||||
$element_options[$i]->is_db_live = 1;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//populate elements
|
||||
$element[$j] = new stdClass();
|
||||
$element[$j]->title = $row['element_title'];
|
||||
$element[$j]->guidelines = $row['element_guidelines'];
|
||||
$element[$j]->size = $row['element_size'];
|
||||
$element[$j]->is_required = $row['element_is_required'];
|
||||
$element[$j]->is_unique = $row['element_is_unique'];
|
||||
$element[$j]->is_private = $row['element_is_private'];
|
||||
$element[$j]->type = $row['element_type'];
|
||||
$element[$j]->position = $row['element_position'];
|
||||
$element[$j]->id = $row['element_id'];
|
||||
$element[$j]->is_db_live = 1;
|
||||
$element[$j]->default_value = $row['element_default_value'];
|
||||
$element[$j]->constraint = $row['element_constraint'];
|
||||
if(!empty($element_options)){
|
||||
$element[$j]->options = $element_options;
|
||||
}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');
|
||||
?>
|
||||
|
||||
<div id="main">
|
||||
<form id="form_result" action="">
|
||||
<ul id="form_elements"></ul>
|
||||
|
||||
<div class="notification" style="display: <?php if(empty($element)){ echo 'block'; } else { echo 'none'; }; ?>;" id="nofields" onclick="display_fields(0)">
|
||||
<h2>You have no fields yet!</h2>
|
||||
<p>Click the buttons on the right to add fields to your form.</p>
|
||||
</div>
|
||||
|
||||
<div id="div_button" class="buttons <?php if(empty($element)){ echo ' hide'; } ?>">
|
||||
<a href="#" id="form_save_button" class="positive">
|
||||
<img src="images/icons/filesave.gif" alt=""> Save Form</a>
|
||||
</div>
|
||||
</form>
|
||||
<div id="debug_box"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="sidebar">
|
||||
<ul id="tabs" class="add_field_tab">
|
||||
<li id="add_field_tab"><a href="javascript:display_fields(0);" title="Add a Field">Add a Field</a></li>
|
||||
<li id="field_prop_tab"><a href="javascript:display_field_properties();" title="Field Properties">Field Properties</a></li>
|
||||
<li id="form_prop_tab"><a href="javascript:display_form_properties();" title="Form Properties">Form Properties</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<div style="display: block;" id="add_elements">
|
||||
<div style="padding-bottom: 5px; text-align: center"><img src="images/click_to_add.gif" /></div>
|
||||
|
||||
<div id="element_buttons">
|
||||
<ul id="first_column">
|
||||
<li><a id="single_line_text" href="javascript:insert_element('text')"><img src="images/button_text/single_line_text.gif" /></a></li>
|
||||
<li><a id="paragraph_text" href="javascript:insert_element('textarea');"><img src="images/button_text/paragraph_text.gif" /></a></li>
|
||||
<li><a id="multiple_choice" href="javascript:insert_element('radio');"><img src="images/button_text/multiple_choice.gif" /></a></li>
|
||||
<li><a id="name_text" href="javascript:insert_element('simple_name');"><img src="images/button_text/name.gif" /></a></li>
|
||||
<li><a id="time" href="javascript:insert_element('time');"><img src="images/button_text/time.gif" /></a></li>
|
||||
<li><a id="address" href="javascript:insert_element('address');"><img src="images/button_text/address.gif" /></a></li>
|
||||
<li><a id="price" href="javascript:insert_element('currency');"><img src="images/button_text/price.gif" /></a></li>
|
||||
<li><a id="section_break" href="javascript:insert_element('section');" title="Organize your form."><img src="images/button_text/section_break.gif" /></a></li>
|
||||
</ul>
|
||||
|
||||
<ul id="second_column">
|
||||
<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="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>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<form style="display: block;" id="element_properties" action="" onsubmit="return false;">
|
||||
<div class="element_inactive" id="element_inactive">
|
||||
<h3><b>Please select a field</b></h3>
|
||||
<p>Click on a field on the left to change its properties.</p>
|
||||
</div>
|
||||
|
||||
<div class="num" id="element_position">1</div>
|
||||
<ul id="all_properties">
|
||||
<li>
|
||||
<label class="desc" for="element_label">
|
||||
Field Label
|
||||
<a href="#" class="tooltip" title="Field Label" rel="Field Label is one or two words placed directly above the field.">(?)</a>
|
||||
</label>
|
||||
<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>
|
||||
|
||||
<li class="left half" id="prop_element_type">
|
||||
<label class="desc" for="element_type">
|
||||
Field Type
|
||||
<a href="#" class="tooltip" title="Field Type" rel="Field Type detemines what kind of data can be collected by your field. After you save the form, the field type cannot be changed.">(?)</a>
|
||||
</label>
|
||||
<select class="select full" id="element_type" autocomplete="off" tabindex="12" onchange="set_properties(JJ(this).val(), 'type')">
|
||||
<option value="text">Single Line Text</option>
|
||||
<option value="textarea">Paragraph Text</option>
|
||||
<option value="radio">Multiple Choice</option>
|
||||
<option value="checkbox">Checkboxes</option>
|
||||
<option value="select">Drop Down</option>
|
||||
<option value="number">Number</option>
|
||||
<option value="simple_name">Name</option>
|
||||
<option value="date">Date</option>
|
||||
<option value="time">Time</option>
|
||||
<option value="phone">Phone</option>
|
||||
<option value="money">Price</option>
|
||||
<option value="url">Web Site</option>
|
||||
<option value="email">Email</option>
|
||||
<option value="address">Address</option>
|
||||
<option value="file">File Upload</option>
|
||||
<option value="section">Section Break</option>
|
||||
</select>
|
||||
</li>
|
||||
|
||||
<li class="right half" id="prop_element_size">
|
||||
<label class="desc" for="field_size">
|
||||
Field Size
|
||||
<a href="#" class="tooltip" title="Field Size" rel="This property set the visual appearance of the field in your form. It does not limit nor increase the amount of data that can be collected by the field.">(?)</a>
|
||||
</label>
|
||||
<select class="select full" id="field_size" autocomplete="off" tabindex="13" onchange="set_properties(JJ(this).val(), 'size')">
|
||||
<option value="small">Small</option>
|
||||
<option value="medium">Medium</option>
|
||||
<option value="large">Large</option>
|
||||
</select>
|
||||
</li>
|
||||
|
||||
<li class="right half" id="prop_date_format">
|
||||
<label class="desc" for="field_size">
|
||||
Date Format
|
||||
<a href="#" class="tooltip" title="Date Format" rel="You can choose between American and European Date Formats">(?)</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>
|
||||
</select>
|
||||
</li>
|
||||
|
||||
<li class="right half" id="prop_name_format">
|
||||
<label class="desc" for="name_format">
|
||||
Name Format
|
||||
<a href="#" class="tooltip" title="Name Format" rel="Two format available. A normal name field, or an extended name field with title and suffix.">(?)</a>
|
||||
</label>
|
||||
<select class="select full" id="name_format" autocomplete="off" onchange="set_properties(JJ(this).val(), 'type')">
|
||||
<option id="element_simple_name" value="simple_name" selected="selected">Normal</option>
|
||||
<option id="element_name" value="name">Extended</option>
|
||||
</select>
|
||||
</li>
|
||||
|
||||
<li class="right half" id="prop_phone_format">
|
||||
<label class="desc" for="field_size">
|
||||
Phone Format
|
||||
<a href="#" class="tooltip" title="Phone Format" rel="You can choose between American and International Phone Formats">(?)</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">International</option>
|
||||
</select>
|
||||
</li>
|
||||
|
||||
<li class="right half" id="prop_currency_format">
|
||||
<label class="desc" for="field_size">
|
||||
Currency Format
|
||||
</label>
|
||||
<select class="select full" id="money_format" autocomplete="off" onchange="set_properties(JJ(this).val(), 'constraint')">
|
||||
<option id="element_money_usd" value="dollar">$ Dollars</option>
|
||||
<option id="element_money_euro" value="euro">€ Euros</option>
|
||||
<option id="element_money_pound" value="pound">£ Pounds</option>
|
||||
<option id="element_money_yen" value="yen">¥ Yen</option>
|
||||
</select>
|
||||
</li>
|
||||
|
||||
<li class="clear" id="prop_choices">
|
||||
<fieldset class="choices">
|
||||
<legend>
|
||||
Choices
|
||||
<a href="#" class="tooltip" title="Choices" rel="Use the plus and minus buttons to add and delete choices. Click on the star to make a choice the default selection.">(?)</a>
|
||||
</legend>
|
||||
<ul id="element_choices">
|
||||
</ul>
|
||||
</fieldset>
|
||||
</li>
|
||||
|
||||
<li class="left half clear" id="prop_options">
|
||||
<fieldset class="fieldset">
|
||||
<legend>Rules</legend>
|
||||
<input id="element_required" class="checkbox" value="" tabindex="14" onclick="(this.checked) ? checkVal = '1' : checkVal = '0';set_properties(checkVal, 'is_required')" type="checkbox">
|
||||
<label class="choice" for="element_required">Required</label>
|
||||
<a href="#" class="tooltip" title="Required" rel="Checking this rule will make sure that a user fills out a particular field. A message will be displayed to the user if they have not filled out the field.">(?)</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">No Duplicates</label>
|
||||
<a href="#" class="tooltip" title="No Duplicates" rel="Checking this rule will verify that the data entered into this field is unique and has not been submitted previously.">(?)</a></span><br>
|
||||
</fieldset>
|
||||
</li>
|
||||
|
||||
<li class="right half" id="prop_access_control">
|
||||
<fieldset class="fieldset">
|
||||
<legend>Field Visible to</legend>
|
||||
<input id="fieldPublic" name="security" class="radio" value="" checked="checked" tabindex="16" onclick="set_properties('0', 'is_private')" type="radio">
|
||||
<label class="choice" for="fieldPublic">Everyone</label>
|
||||
<a href="#" class="tooltip" title="Visible to Everyone" rel="This is the default option. The field will be accessible by anyone when the form is made public.">(?)</a><br>
|
||||
<span id="admin_only_span">
|
||||
<input id="fieldPrivate" name="security" class="radio" value="" tabindex="17" onclick="set_properties('1', 'is_private')" type="radio">
|
||||
<label class="choice" for="fieldPrivate">Admin Only</label>
|
||||
<a href="#" class="tooltip" title="Admin Only" rel="Fields that are set to 'Admin Only' will not be shown to users when the form is made public.">(?)</a></span><br>
|
||||
</fieldset>
|
||||
</li>
|
||||
|
||||
<li class="left half clear" id="prop_randomize">
|
||||
<fieldset class="fieldset">
|
||||
<legend>Randomize</legend>
|
||||
<input id="element_not_random" name="randomize" class="radio" value="" checked="checked" tabindex="16" onclick="set_properties('', 'constraint')" type="radio">
|
||||
<label class="choice" for="element_not_random">Static Order</label>
|
||||
<a href="#" class="tooltip" title="Static Order" rel="This is the default option. Options will always be displayed in the order you have created them.">(?)</a><br>
|
||||
|
||||
<input id="element_random" name="randomize" class="radio" value="" tabindex="16" onclick="set_properties('random', 'constraint')" type="radio">
|
||||
<label class="choice" for="element_random">Random Order</label>
|
||||
<a href="#" class="tooltip" title="Random Order" rel="Choose this if you would like the options to be shuffled around each time someone views your form.">(?)</a><br>
|
||||
</fieldset>
|
||||
</li>
|
||||
|
||||
<li class="clear" id="prop_time_noseconds" style="padding-top: 5px">
|
||||
<input id="time_noseconds" class="checkbox" value="" onclick="(this.checked) ? checkVal = 'show_seconds' : checkVal = '';set_properties(checkVal, 'constraint')" type="checkbox" style="margin-left: 0px;margin-top: -15px">
|
||||
<label class="choice" for="time_noseconds">Show Seconds field</label>
|
||||
<a href="#" class="tooltip" title="Show Seconds field" rel="Checking this will enable Seconds field on your time field.">(?)</a><br>
|
||||
</li>
|
||||
|
||||
<li class="clear" id="prop_default_value">
|
||||
<label class="desc" for="element_default">
|
||||
Default Value
|
||||
<a href="#" class="tooltip" title="Default Value" rel="By setting this value, the field will be prepopulated with the text you enter.">(?)</a>
|
||||
</label>
|
||||
|
||||
<input id="element_default" class="text large" name="text" value="" tabindex="11" maxlength="255" onkeyup="set_properties(JJ(this).val(), 'default_value')" onblur="set_properties(JJ(this).val(), 'default_value')" type="text">
|
||||
</li>
|
||||
|
||||
<li class="clear" id="prop_default_country">
|
||||
<label class="desc" for="fieldaddress_default">
|
||||
Default Country
|
||||
<a href="#" class="tooltip" title="Default Country" rel="By setting this value, the country field will be prepopulated with the selection you make.">(?)</a>
|
||||
</label>
|
||||
<select class="select medium" id="element_countries" onchange="set_properties(JJ(this).val(), 'default_value')">
|
||||
<option value=""></option>
|
||||
|
||||
<optgroup label="North America">
|
||||
<option value="Antigua and Barbuda">Antigua and Barbuda</option>
|
||||
<option value="Bahamas">Bahamas</option>
|
||||
<option value="Barbados">Barbados</option>
|
||||
<option value="Belize">Belize</option>
|
||||
<option value="Canada">Canada</option>
|
||||
<option value="Costa Rica">Costa Rica</option>
|
||||
<option value="Cuba">Cuba</option>
|
||||
<option value="Dominica">Dominica</option>
|
||||
<option value="Dominican Republic">Dominican Republic</option>
|
||||
<option value="El Salvador">El Salvador</option>
|
||||
<option value="Grenada">Grenada</option>
|
||||
<option value="Guatemala">Guatemala</option>
|
||||
<option value="Haiti">Haiti</option>
|
||||
<option value="Honduras">Honduras</option>
|
||||
<option value="Jamaica">Jamaica</option>
|
||||
<option value="Mexico">Mexico</option>
|
||||
<option value="Nicaragua">Nicaragua</option>
|
||||
<option value="Panama">Panama</option>
|
||||
<option value="Puerto Rico">Puerto Rico</option>
|
||||
<option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
|
||||
<option value="Saint Lucia">Saint Lucia</option>
|
||||
<option value="Saint Vincent and the Grenadines">Saint Vincent and the Grenadines</option>
|
||||
<option value="Trinidad and Tobago">Trinidad and Tobago</option>
|
||||
<option value="United States">United States</option>
|
||||
</optgroup>
|
||||
|
||||
<optgroup label="South America">
|
||||
<option value="Argentina">Argentina</option>
|
||||
<option value="Bolivia">Bolivia</option>
|
||||
<option value="Brazil">Brazil</option>
|
||||
<option value="Chile">Chile</option>
|
||||
<option value="Columbia">Columbia</option>
|
||||
<option value="Ecuador">Ecuador</option>
|
||||
<option value="Guyana">Guyana</option>
|
||||
<option value="Paraguay">Paraguay</option>
|
||||
<option value="Peru">Peru</option>
|
||||
<option value="Suriname">Suriname</option>
|
||||
<option value="Uruguay">Uruguay</option>
|
||||
<option value="Venezuela">Venezuela</option>
|
||||
</optgroup>
|
||||
|
||||
<optgroup label="Europe">
|
||||
<option value="Albania">Albania</option>
|
||||
<option value="Andorra">Andorra</option>
|
||||
<option value="Armenia">Armenia</option>
|
||||
<option value="Austria">Austria</option>
|
||||
<option value="Azerbaijan">Azerbaijan</option>
|
||||
<option value="Belarus">Belarus</option>
|
||||
<option value="Belgium">Belgium</option>
|
||||
<option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
|
||||
<option value="Bulgaria">Bulgaria</option>
|
||||
<option value="Croatia">Croatia</option>
|
||||
<option value="Cyprus">Cyprus</option>
|
||||
<option value="Czech Republic">Czech Republic</option>
|
||||
<option value="Denmark">Denmark</option>
|
||||
<option value="Estonia">Estonia</option>
|
||||
<option value="Finland">Finland</option>
|
||||
<option value="France">France</option>
|
||||
<option value="Georgia">Georgia</option>
|
||||
<option value="Germany">Germany</option>
|
||||
<option value="Greece">Greece</option>
|
||||
<option value="Hungary">Hungary</option>
|
||||
<option value="Iceland">Iceland</option>
|
||||
<option value="Ireland">Ireland</option>
|
||||
<option value="Italy">Italy</option>
|
||||
<option value="Latvia">Latvia</option>
|
||||
<option value="Liechtenstein">Liechtenstein</option>
|
||||
<option value="Lithuania">Lithuania</option>
|
||||
<option value="Luxembourg">Luxembourg</option>
|
||||
<option value="Macedonia">Macedonia</option>
|
||||
<option value="Malta">Malta</option>
|
||||
<option value="Moldova">Moldova</option>
|
||||
<option value="Monaco">Monaco</option>
|
||||
<option value="Montenegro">Montenegro</option>
|
||||
<option value="Netherlands">Netherlands</option>
|
||||
<option value="Norway">Norway</option>
|
||||
<option value="Poland">Poland</option>
|
||||
<option value="Portugal">Portugal</option>
|
||||
<option value="Romania">Romania</option>
|
||||
<option value="San Marino">San Marino</option>
|
||||
<option value="Serbia">Serbia</option>
|
||||
<option value="Slovakia">Slovakia</option>
|
||||
<option value="Slovenia">Slovenia</option>
|
||||
<option value="Spain">Spain</option>
|
||||
<option value="Sweden">Sweden</option>
|
||||
<option value="Switzerland">Switzerland</option>
|
||||
<option value="Ukraine">Ukraine</option>
|
||||
<option value="United Kingdom">United Kingdom</option>
|
||||
<option value="Vatican City">Vatican City</option>
|
||||
</optgroup>
|
||||
|
||||
<optgroup label="Asia">
|
||||
<option value="Afghanistan">Afghanistan</option>
|
||||
<option value="Bahrain">Bahrain</option>
|
||||
<option value="Bangladesh">Bangladesh</option>
|
||||
<option value="Bhutan">Bhutan</option>
|
||||
<option value="Brunei Darussalam">Brunei Darussalam</option>
|
||||
<option value="Myanmar">Myanmar</option>
|
||||
<option value="Cambodia">Cambodia</option>
|
||||
<option value="China">China</option>
|
||||
<option value="East Timor">East Timor</option>
|
||||
<option value="Hong Kong">Hong Kong</option>
|
||||
<option value="India">India</option>
|
||||
<option value="Indonesia">Indonesia</option>
|
||||
<option value="Iran">Iran</option>
|
||||
<option value="Iraq">Iraq</option>
|
||||
<option value="Israel">Israel</option>
|
||||
<option value="Japan">Japan</option>
|
||||
<option value="Jordan">Jordan</option>
|
||||
<option value="Kazakhstan">Kazakhstan</option>
|
||||
<option value="North Korea">North Korea</option>
|
||||
<option value="South Korea">South Korea</option>
|
||||
<option value="Kuwait">Kuwait</option>
|
||||
<option value="Kyrgyzstan">Kyrgyzstan</option>
|
||||
<option value="Laos">Laos</option>
|
||||
<option value="Lebanon">Lebanon</option>
|
||||
<option value="Malaysia">Malaysia</option>
|
||||
<option value="Maldives">Maldives</option>
|
||||
<option value="Mongolia">Mongolia</option>
|
||||
<option value="Nepal">Nepal</option>
|
||||
<option value="Oman">Oman</option>
|
||||
<option value="Pakistan">Pakistan</option>
|
||||
<option value="Philippines">Philippines</option>
|
||||
<option value="Qatar">Qatar</option>
|
||||
<option value="Russia">Russia</option>
|
||||
<option value="Saudi Arabia">Saudi Arabia</option>
|
||||
<option value="Singapore">Singapore</option>
|
||||
<option value="Sri Lanka">Sri Lanka</option>
|
||||
<option value="Syria">Syria</option>
|
||||
<option value="Taiwan">Taiwan</option>
|
||||
<option value="Tajikistan">Tajikistan</option>
|
||||
<option value="Thailand">Thailand</option>
|
||||
<option value="Turkey">Turkey</option>
|
||||
<option value="Turkmenistan">Turkmenistan</option>
|
||||
<option value="United Arab Emirates">United Arab Emirates</option>
|
||||
<option value="Uzbekistan">Uzbekistan</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="Kiribati">Kiribati</option>
|
||||
<option value="Marshall Islands">Marshall Islands</option>
|
||||
<option value="Micronesia">Micronesia</option>
|
||||
<option value="Nauru">Nauru</option>
|
||||
<option value="New Zealand">New Zealand</option>
|
||||
<option value="Palau">Palau</option>
|
||||
<option value="Papua New Guinea">Papua New Guinea</option>
|
||||
<option value="Samoa">Samoa</option>
|
||||
<option value="Solomon Islands">Solomon Islands</option>
|
||||
<option value="Tonga">Tonga</option>
|
||||
<option value="Tuvalu">Tuvalu</option>
|
||||
<option value="Vanuatu">Vanuatu</option>
|
||||
</optgroup>
|
||||
|
||||
<optgroup label="Africa">
|
||||
<option value="Algeria">Algeria</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">Cameroon</option>
|
||||
<option value="Cape Verde">Cape Verde</option>
|
||||
<option value="Central African Republic">Central African Republic</option>
|
||||
<option value="Chad">Chad</option>
|
||||
<option value="Comoros">Comoros</option>
|
||||
<option value="Congo">Congo</option>
|
||||
<option value="Djibouti">Djibouti</option>
|
||||
<option value="Egypt">Egypt</option>
|
||||
<option value="Equatorial Guinea">Equatorial Guinea</option>
|
||||
<option value="Eritrea">Eritrea</option>
|
||||
<option value="Ethiopia">Ethiopia</option>
|
||||
<option value="Gabon">Gabon</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">Libya</option>
|
||||
<option value="Madagascar">Madagascar</option>
|
||||
<option value="Malawi">Malawi</option>
|
||||
<option value="Mali">Mali</option>
|
||||
<option value="Mauritania">Mauritania</option>
|
||||
<option value="Mauritius">Mauritius</option>
|
||||
<option value="Morocco">Morocco</option>
|
||||
<option value="Mozambique">Mozambique</option>
|
||||
<option value="Namibia">Namibia</option>
|
||||
<option value="Niger">Niger</option>
|
||||
<option value="Nigeria">Nigeria</option>
|
||||
<option value="Rwanda">Rwanda</option>
|
||||
<option value="Sao Tome and Principe">Sao Tome and Principe</option>
|
||||
<option value="Senegal">Senegal</option>
|
||||
<option value="Seychelles">Seychelles</option>
|
||||
<option value="Sierra Leone">Sierra Leone</option>
|
||||
<option value="Somalia">Somalia</option>
|
||||
<option value="South Africa">South Africa</option>
|
||||
<option value="Sudan">Sudan</option>
|
||||
<option value="Swaziland">Swaziland</option>
|
||||
<option value="United Republic of Tanzania">Tanzania</option>
|
||||
<option value="Togo">Togo</option>
|
||||
<option value="Tunisia">Tunisia</option>
|
||||
<option value="Uganda">Uganda</option>
|
||||
<option value="Zambia">Zambia</option>
|
||||
<option value="Zimbabwe">Zimbabwe</option>
|
||||
</optgroup>
|
||||
</select>
|
||||
</li>
|
||||
|
||||
<li class="clear" id="prop_phone_default">
|
||||
<label class="desc" for="element_phone_default1">
|
||||
Default Value
|
||||
<a href="#" class="tooltip" title="Default Value" rel="By setting this value, the field will be prepopulated with the text you enter.">(?)</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_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">
|
||||
</li>
|
||||
|
||||
|
||||
<li class="clear">
|
||||
<label class="desc" for="element_instructions">
|
||||
Guidelines for User
|
||||
<a href="#" class="tooltip" title="Guidelines" rel="This text will be displayed to your users while they're filling out particular field.">(?)</a>
|
||||
</label>
|
||||
|
||||
<textarea class="textarea full" rows="10" cols="50" id="element_instructions" tabindex="18" onkeyup="set_properties(this.value, 'guidelines')" onblur="set_properties(this.value, 'guidelines')"></textarea>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
<ul id="add_elements_button" style="display: none; padding-top: 5px">
|
||||
<li class="buttons" id="list_buttons">
|
||||
<a href="#" onclick="display_fields(0);return false">
|
||||
<img src="images/icons/textfield_add.gif" alt="">Add Another Field</a>
|
||||
</li>
|
||||
</ul>
|
||||
<form style="display: none;" id="form_properties" action="" onsubmit="return false;">
|
||||
<ul>
|
||||
<li>
|
||||
<label class="desc" for="form_title">Form Title <a class="tooltip" title="Form Title" rel="The title of your form displayed to the user when they see your form.">(?)</a></label>
|
||||
<input id="form_title" class="text medium" value="" tabindex="1" maxlength="50" onkeyup="update_form(this.value, 'name')" onblur="update_form(this.value, 'name')" type="text">
|
||||
</li>
|
||||
<li>
|
||||
<label class="desc" for="form_description">Description <a class="tooltip" title="Description" rel="This will appear directly below the form name. Useful for displaying a short description or any instructions, notes, guidelines.">(?)</a></label>
|
||||
<textarea class="textarea small" rows="10" cols="50" id="form_description" tabindex="2" onkeyup="update_form(this.value, 'description')" onblur="update_form(this.value, 'description')"></textarea>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<input id="form_password_option" class="checkbox" value="" tabindex="5" type="checkbox">
|
||||
<label class="choice" for="form_password_option"><b>Turn On Password Protection</b></label>
|
||||
<a class="tooltip" title="Turn On Password Protection" rel="If enabled, all users accessing the public form will then be required to type in the password to access the form. Your form is password protected.">(?)</a><br>
|
||||
<div id="form_password" class="password hide">
|
||||
<img src="images/icons/key.gif" alt="Password : ">
|
||||
<input id="form_password_data" class="text" value="" size="25" tabindex="6" maxlength="255" onkeyup="update_form(this.value, 'password')" onblur="update_form(this.value, 'password')" type="password">
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<input id="form_captcha" class="checkbox" value="" onchange="(this.checked)?update_form('1', 'captcha'):update_form('0','captcha');" tabindex="6" type="checkbox">
|
||||
<label class="choice" for="form_captcha"><b>Turn On Spam Protection (CAPTCHA)</b></label>
|
||||
<a class="tooltip" title="Turn On Spam Protection (CAPTCHA)" rel="If enabled, an image with random words will be generated (audio also provided) and users will be required to enter the correct words to be able submitting your form. This is useful to prevent abuse from bots or automated programs usually written to generate spam.">(?)</a><br>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<input id="form_unique_ip" class="checkbox" value="" onchange="(this.checked)?update_form('1', 'unique_ip'):update_form('0','unique_ip');" tabindex="7" type="checkbox">
|
||||
<label class="choice" for="form_unique_ip"><b>Limit One Entry Per User</b></label>
|
||||
<a class="tooltip" title="Limit One Entry Per User" rel="Use this to prevent users from filling out your form more than once. This is done by comparing user's IP Address.">(?)</a><br>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<input id="form_review" class="checkbox" value="" onchange="(this.checked)?update_form('1', 'review'):update_form('0','review');" tabindex="8" type="checkbox">
|
||||
<label class="choice" for="form_review"><b>Show Review Page Before Submitting</b></label>
|
||||
<a class="tooltip" title="Show Review Page Before Submitting" rel="If enabled, users will be prompted to a preview page that lets them double check their entries before submitting the form.">(?)</a><br>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<fieldset>
|
||||
<legend>Success Message</legend>
|
||||
|
||||
<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">Show Text</label>
|
||||
<a class="tooltip" title="Success Message" rel="This message will be displayed after your users have successfully submitted an entry.">(?)</a>
|
||||
</div>
|
||||
|
||||
<div class="right">
|
||||
<input id="form_redirect_option" name="confirmation" class="radio" value="" tabindex="7" onclick="update_form(redirect_url, 'redirect'); Element.addClassName('form_success_message', 'hide');Element.removeClassName('form_redirect_url', 'hide');" type="radio">
|
||||
<label class="choice" for="form_redirect_option">Redirect URL</label>
|
||||
<a class="tooltip" title="Redirect URL" rel="After your users have successfully submitted an entry, you can redirect them to another
|
||||
website/URL of your choice.">(?)</a>
|
||||
</div>
|
||||
|
||||
<textarea class="textarea full" rows="10" cols="50" id="form_success_message" tabindex="9" onkeyup="update_form(JJ(this).val(), 'success_message')" onblur="update_form(JJ(this).val(), 'success_message')"><?php echo $form->success_message; ?></textarea>
|
||||
|
||||
<input id="form_redirect_url" class="text full hide" name="text" value="http://" tabindex="10" onkeyup="redirect_url = JJ(this).val();update_form(JJ(this).val(), 'redirect')" onblur="urlInHistory = JJ(this).val();update_form(JJ(this).val(), 'redirect')" type="text">
|
||||
</fieldset>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$footer_data =<<<EOT
|
||||
<script type="text/javascript">
|
||||
var json_form = {$json_form};
|
||||
var json_elements = {$json_element};
|
||||
</script>
|
||||
EOT;
|
||||
require('includes/footer.php');
|
||||
?>
|
||||
127
email_entry.php
Normal file
@ -0,0 +1,127 @@
|
||||
<?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');
|
||||
require('includes/db-functions.php');
|
||||
require('includes/helper-functions.php');
|
||||
require('includes/entry-functions.php');
|
||||
require('lib/class.phpmailer.php');
|
||||
|
||||
connect_db();
|
||||
|
||||
$form_id = (int) trim($_REQUEST['form_id']);
|
||||
$entry_id = (int) trim($_REQUEST['entry_id']);
|
||||
|
||||
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
|
||||
|
||||
|
||||
if (empty($action)) {
|
||||
|
||||
// Send back the HTML form
|
||||
echo "<div style='display:none'>
|
||||
<a href='#' title='Close' class='modalCloseX modalClose'>x</a>
|
||||
<div class='contact-top'></div>
|
||||
<div class='contact-content'>
|
||||
<h1 class='contact-title'>Email Entry #{$entry_id} to:</h1>
|
||||
<div class='contact-loading' style='display:none'></div>
|
||||
<div class='contact-message' style='display:none'></div>
|
||||
<form action='#' style='display:none'>
|
||||
<input type='text' id='contact-email' class='contact-input' name='email' tabindex='1003' /><br/>
|
||||
Use commas to separate email addresses<br/><br />
|
||||
<button type='submit' class='contact-send contact-button' tabindex='1004' style='float: none'>Send</button>
|
||||
<button type='submit' class='contact-cancel contact-button modalClose' tabindex='1005' style='float: none'>Cancel</button>
|
||||
<br/>
|
||||
<input type='hidden' name='form_id' value='{$form_id}' />
|
||||
<input type='hidden' name='entry_id' value='{$entry_id}' />
|
||||
</form>
|
||||
</div>
|
||||
<div class='contact-bottom'></div>
|
||||
</div>";
|
||||
}elseif ($action == 'send') {
|
||||
|
||||
$to_emails = trim($_REQUEST['email']);
|
||||
|
||||
//get form properties data
|
||||
$query = "select
|
||||
esl_from_name,
|
||||
esl_from_email_address,
|
||||
esl_subject,
|
||||
esl_content,
|
||||
esl_plain_text
|
||||
from
|
||||
`ap_forms`
|
||||
where
|
||||
form_id='$form_id'";
|
||||
|
||||
$result = do_query($query);
|
||||
$row = do_fetch_result($result);
|
||||
|
||||
$esl_from_name = $row['esl_from_name'];
|
||||
$esl_from_email_address = $row['esl_from_email_address'];
|
||||
$esl_subject = $row['esl_subject'];
|
||||
$esl_content = $row['esl_content'];
|
||||
$esl_plain_text = $row['esl_plain_text'];
|
||||
|
||||
//get parameters for the email
|
||||
|
||||
//from name
|
||||
if(!empty($esl_from_name)){
|
||||
$admin_email_param['from_name'] = $esl_from_name;
|
||||
}elseif (NOTIFICATION_MAIL_FROM_NAME != ''){
|
||||
$admin_email_param['from_name'] = NOTIFICATION_MAIL_FROM_NAME;
|
||||
}else{
|
||||
$admin_email_param['from_name'] = 'MachForm';
|
||||
}
|
||||
|
||||
//from email address
|
||||
if(!empty($esl_from_email_address)){
|
||||
if(is_numeric($esl_from_email_address)){
|
||||
$admin_email_param['from_email'] = '{element_'.$esl_from_email_address.'}';
|
||||
}else{
|
||||
$admin_email_param['from_email'] = $esl_from_email_address;
|
||||
}
|
||||
}elseif(NOTIFICATION_MAIL_FROM != ''){
|
||||
$admin_email_param['from_email'] = NOTIFICATION_MAIL_FROM;
|
||||
}else{
|
||||
$domain = str_replace('www.','',$_SERVER['SERVER_NAME']);
|
||||
$admin_email_param['from_email'] = "no-reply@{$domain}";
|
||||
}
|
||||
|
||||
//subject
|
||||
if(!empty($esl_subject)){
|
||||
$admin_email_param['subject'] = $esl_subject;
|
||||
}elseif (NOTIFICATION_MAIL_SUBJECT != ''){
|
||||
$admin_email_param['subject'] = NOTIFICATION_MAIL_SUBJECT;
|
||||
}else{
|
||||
$admin_email_param['subject'] = '{form_name} [#{entry_no}]';
|
||||
}
|
||||
|
||||
//content
|
||||
if(!empty($esl_content)){
|
||||
$admin_email_param['content'] = $esl_content;
|
||||
}else{
|
||||
$admin_email_param['content'] = '{entry_data}';
|
||||
}
|
||||
|
||||
$admin_email_param['as_plain_text'] = $esl_plain_text;
|
||||
$admin_email_param['target_is_admin'] = true;
|
||||
|
||||
send_notification($form_id,$entry_id,$to_emails,$admin_email_param);
|
||||
|
||||
echo "Entry #{$entry_id} successfully sent.";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
539
email_settings.css
Normal file
@ -0,0 +1,539 @@
|
||||
#esl_main_body, #esr_main_body
|
||||
{
|
||||
background:#fffff;
|
||||
font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
|
||||
font-size:small;
|
||||
margin:8px 0 16px;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
#esl_form_container, #esr_form_container
|
||||
{
|
||||
background:#fff;
|
||||
border:1px solid #ccc;
|
||||
margin:0 auto;
|
||||
text-align:left;
|
||||
width:640px;
|
||||
}
|
||||
|
||||
|
||||
form.appnitro
|
||||
{
|
||||
margin:20px 20px 0;
|
||||
padding:0px;
|
||||
}
|
||||
|
||||
.esl_options{
|
||||
display: none;
|
||||
}
|
||||
.esr_options{
|
||||
display: none;
|
||||
}
|
||||
/**** Form Section ****/
|
||||
.appnitro
|
||||
{
|
||||
font-family:Lucida Grande, Tahoma, Arial, Verdana, sans-serif;
|
||||
font-size:small;
|
||||
}
|
||||
|
||||
.appnitro li
|
||||
{
|
||||
width:98%;
|
||||
padding-right: 0px !important;
|
||||
|
||||
}
|
||||
|
||||
#esl_main_body form ul,#esr_main_body form ul
|
||||
{
|
||||
font-size:100%;
|
||||
list-style-type:none;
|
||||
margin:0;
|
||||
padding:0;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
#esl_main_body form li,#esr_main_body form li
|
||||
{
|
||||
/*display:block;*/
|
||||
margin:0;
|
||||
padding:4px 5px 2px 9px;
|
||||
position:relative;
|
||||
}
|
||||
|
||||
#esl_main_body form li:after,#esr_main_body form li:after
|
||||
{
|
||||
clear:both;
|
||||
content:".";
|
||||
display:block;
|
||||
height:0;
|
||||
visibility:hidden;
|
||||
}
|
||||
|
||||
#esl_main_body .buttons:after,#esr_main_body .buttons:after
|
||||
{
|
||||
clear:both;
|
||||
content:".";
|
||||
display:block;
|
||||
height:0;
|
||||
visibility:hidden;
|
||||
}
|
||||
|
||||
#esl_main_body .buttons,#esr_main_body .buttons
|
||||
{
|
||||
clear:both;
|
||||
display:block;
|
||||
width: 100%;
|
||||
|
||||
}
|
||||
|
||||
#esl_main_body html form li div,#esr_main_body html form li div
|
||||
{
|
||||
display:inline-block;
|
||||
}
|
||||
|
||||
#esl_main_body form li div,#esr_main_body form li div
|
||||
{
|
||||
color:#444;
|
||||
margin:0 4px 0 0;
|
||||
padding:0 0 8px;
|
||||
}
|
||||
|
||||
#esl_main_body form li span,#esr_main_body form li span
|
||||
{
|
||||
color:#444;
|
||||
float:left;
|
||||
margin:0 4px 0 0;
|
||||
padding:0px !important;
|
||||
}
|
||||
|
||||
#esl_main_body form li div.left,#esr_main_body form li div.left
|
||||
{
|
||||
display:inline;
|
||||
float:left;
|
||||
width:48%;
|
||||
}
|
||||
|
||||
#esl_main_body form li div.right,#esr_main_body form li div.right
|
||||
{
|
||||
display:inline;
|
||||
float:right;
|
||||
width:48%;
|
||||
}
|
||||
|
||||
#esl_main_body form li div.left .medium,#esr_main_body form li div.left .medium
|
||||
{
|
||||
width:100%;
|
||||
}
|
||||
|
||||
#esl_main_body form li div.right .medium,#esr_main_body form li div.right .medium
|
||||
{
|
||||
width:100%;
|
||||
}
|
||||
|
||||
#esl_main_body .clear,#esr_main_body .clear
|
||||
{
|
||||
clear:both;
|
||||
}
|
||||
|
||||
#esl_main_body form li div label,#esr_main_body form li div label
|
||||
{
|
||||
clear:both;
|
||||
color:#444;
|
||||
display:block;
|
||||
font-size:9px;
|
||||
line-height:9px;
|
||||
margin:0;
|
||||
padding-top:3px;
|
||||
}
|
||||
|
||||
#esl_main_body form li span label,#esr_main_body form li span label
|
||||
{
|
||||
clear:both;
|
||||
color:#444;
|
||||
display:block;
|
||||
font-size:9px;
|
||||
line-height:9px;
|
||||
margin:0;
|
||||
padding-top:3px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#esl_main_body form hr,#esr_main_body form hr
|
||||
{
|
||||
display:none;
|
||||
}
|
||||
|
||||
#esl_main_body form li.section_break,#esr_main_body form li.section_break
|
||||
{
|
||||
border-top:1px dotted #ccc;
|
||||
margin-top:9px;
|
||||
padding-bottom:0;
|
||||
padding-left:9px;
|
||||
padding-top:13px;
|
||||
width:97% !important;
|
||||
}
|
||||
|
||||
#esl_main_body form ul li.first,#esr_main_body form ul li.first
|
||||
{
|
||||
border-top:none !important;
|
||||
margin-top:0 !important;
|
||||
padding-top:0 !important;
|
||||
}
|
||||
|
||||
#esl_main_body form .section_break h3,#esr_main_body form .section_break h3
|
||||
{
|
||||
font-size:110%;
|
||||
font-weight:400;
|
||||
line-height:130%;
|
||||
margin:0 0 2px;
|
||||
color: #444;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
#esl_main_body form .section_break p,#esr_main_body form .section_break p
|
||||
{
|
||||
font-size:85%;
|
||||
|
||||
margin:0 0 10px;
|
||||
}
|
||||
|
||||
/**** Buttons ****/
|
||||
#esl_main_body input.button_text,#esr_main_body input.button_text
|
||||
{
|
||||
overflow:visible;
|
||||
padding:0 7px;
|
||||
width:auto;
|
||||
}
|
||||
|
||||
#esl_main_body .buttons input,#esr_main_body .buttons input
|
||||
{
|
||||
font-size:120%;
|
||||
margin-right:5px;
|
||||
}
|
||||
|
||||
/**** Inputs and Labels ****/
|
||||
#esl_main_body label.description,#esr_main_body label.description
|
||||
{
|
||||
border:none;
|
||||
color:#222;
|
||||
display:block;
|
||||
font-size:95%;
|
||||
font-weight:700;
|
||||
line-height:150%;
|
||||
padding:0 0 1px;
|
||||
}
|
||||
|
||||
#esl_main_body span.symbol,#esr_main_body span.symbol
|
||||
{
|
||||
font-size:115%;
|
||||
line-height:130%;
|
||||
}
|
||||
|
||||
#esl_main_body input.text,#esr_main_body input.text
|
||||
{
|
||||
background:#fff url(images/shadow.gif) repeat-x top;
|
||||
border-bottom:1px solid #ddd;
|
||||
border-left:1px solid #c3c3c3;
|
||||
border-right:1px solid #c3c3c3;
|
||||
border-top:1px solid #7c7c7c;
|
||||
color:#333;
|
||||
font-size:100%;
|
||||
margin:0;
|
||||
padding:2px 0;
|
||||
}
|
||||
|
||||
#esl_main_body input.file,#esr_main_body input.file
|
||||
{
|
||||
color:#333;
|
||||
font-size:100%;
|
||||
margin:0;
|
||||
padding:2px 0;
|
||||
}
|
||||
|
||||
#esl_main_body textarea.textarea,#esr_main_body textarea.textarea
|
||||
{
|
||||
background:#fff url(images/shadow.gif) repeat-x top;
|
||||
border-bottom:1px solid #ddd;
|
||||
border-left:1px solid #c3c3c3;
|
||||
border-right:1px solid #c3c3c3;
|
||||
border-top:1px solid #7c7c7c;
|
||||
color:#333;
|
||||
font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
|
||||
font-size:100%;
|
||||
margin:0;
|
||||
width:98%;
|
||||
}
|
||||
|
||||
#esl_main_body select.select,#esr_main_body select.select
|
||||
{
|
||||
color:#333;
|
||||
font-size:100%;
|
||||
margin:1px 0;
|
||||
padding:1px 0 0;
|
||||
background:#fff url(images/shadow.gif) repeat-x top;
|
||||
border-bottom:1px solid #ddd;
|
||||
border-left:1px solid #c3c3c3;
|
||||
border-right:1px solid #c3c3c3;
|
||||
border-top:1px solid #7c7c7c;
|
||||
}
|
||||
|
||||
|
||||
#esl_main_body input.currency,#esr_main_body input.currency
|
||||
{
|
||||
text-align:right;
|
||||
}
|
||||
|
||||
#esl_main_body input.checkbox,#esr_main_body input.checkbox
|
||||
{
|
||||
display:block;
|
||||
height:13px;
|
||||
line-height:1.4em;
|
||||
margin:6px 0 0 3px;
|
||||
width:13px;
|
||||
}
|
||||
|
||||
#esl_main_body input.radio,#esr_main_body input.radio
|
||||
{
|
||||
display:block;
|
||||
height:13px;
|
||||
line-height:1.4em;
|
||||
margin:6px 0 0 3px;
|
||||
width:13px;
|
||||
}
|
||||
|
||||
#esl_main_body label.choice,#esr_main_body label.choice
|
||||
{
|
||||
color:#444;
|
||||
display:block;
|
||||
font-size:100%;
|
||||
line-height:1.4em;
|
||||
margin:-1.55em 0 0 25px;
|
||||
padding:4px 0 5px;
|
||||
width:90%;
|
||||
}
|
||||
|
||||
#esl_main_body select.select[class],#esr_main_body select.select[class]
|
||||
{
|
||||
margin:0;
|
||||
padding:1px 0;
|
||||
}
|
||||
|
||||
*:first-child+html select.select[class]
|
||||
{
|
||||
margin:1px 0;
|
||||
}
|
||||
|
||||
#esl_main_body .safari select.select,#esr_main_body .safari select.select
|
||||
{
|
||||
font-size:120% !important;
|
||||
margin-bottom:1px;
|
||||
}
|
||||
|
||||
#esl_main_body input.small,#esr_main_body input.small
|
||||
{
|
||||
width:25%;
|
||||
}
|
||||
|
||||
#esl_main_body select.small,#esr_main_body select.small
|
||||
{
|
||||
width:25%;
|
||||
}
|
||||
|
||||
#esl_main_body input.medium,#esr_main_body input.medium
|
||||
{
|
||||
width:50%;
|
||||
}
|
||||
|
||||
#esl_main_body select.medium,#esr_main_body select.medium
|
||||
{
|
||||
width:50%;
|
||||
}
|
||||
|
||||
#esl_main_body input.large,#esr_main_body input.large
|
||||
{
|
||||
width:98%;
|
||||
}
|
||||
|
||||
#esl_main_body select.large,#esr_main_body select.large
|
||||
{
|
||||
width:100%;
|
||||
}
|
||||
|
||||
#esl_main_body textarea.small,#esr_main_body textarea.small
|
||||
{
|
||||
height:5.5em;
|
||||
}
|
||||
|
||||
#esl_main_body textarea.medium,#esr_main_body textarea.medium
|
||||
{
|
||||
height:10em;
|
||||
}
|
||||
|
||||
#esl_main_body textarea.large,#esr_main_body textarea.large
|
||||
{
|
||||
height:20em;
|
||||
}
|
||||
|
||||
/**** Errors ****/
|
||||
#error_message
|
||||
{
|
||||
background:#fff;
|
||||
border:1px dotted red;
|
||||
margin-bottom:1em;
|
||||
padding-left:0;
|
||||
padding-right:0;
|
||||
padding-top:4px;
|
||||
text-align:center;
|
||||
width:97%;
|
||||
}
|
||||
|
||||
#error_message_title
|
||||
{
|
||||
color:#DF0000;
|
||||
font-size:125%;
|
||||
margin:7px 0 5px !important;
|
||||
padding:0 !important;
|
||||
}
|
||||
|
||||
#error_message_desc
|
||||
{
|
||||
color:#000;
|
||||
font-size:100%;
|
||||
margin:0 0 .8em !important;
|
||||
}
|
||||
|
||||
#error_message_desc strong
|
||||
{
|
||||
background-color:#FFDFDF;
|
||||
color:red;
|
||||
padding:2px 3px;
|
||||
}
|
||||
|
||||
#esl_main_body form li.error,#esr_main_body form li.error
|
||||
{
|
||||
background-color:#FFDFDF !important;
|
||||
border-bottom:1px solid #EACBCC;
|
||||
border-right:1px solid #EACBCC;
|
||||
margin:3px 0;
|
||||
}
|
||||
|
||||
#esl_main_body form li.error label,#esr_main_body form li.error label
|
||||
{
|
||||
color:#DF0000 !important;
|
||||
}
|
||||
|
||||
#esl_main_body form p.error,#esr_main_body form p.error
|
||||
{
|
||||
clear:both;
|
||||
color:red;
|
||||
font-size:10px;
|
||||
font-weight:700;
|
||||
margin:0 0 5px !important;
|
||||
}
|
||||
|
||||
#esl_main_body form .required,#esr_main_body form .required
|
||||
{
|
||||
color:red !important;
|
||||
float:none !important;
|
||||
font-weight:700;
|
||||
}
|
||||
|
||||
/**** Guidelines and Error Highlight ****/
|
||||
#esl_main_body form li.highlighted,#esr_main_body form li.highlighted
|
||||
{
|
||||
background-color:#fff7c0;
|
||||
}
|
||||
|
||||
#esl_main_body form .guidelines,#esr_main_body form .guidelines
|
||||
{
|
||||
background:#f5f5f5;
|
||||
border:1px solid #e6e6e6;
|
||||
color:#444;
|
||||
font-size:80%;
|
||||
left:100%;
|
||||
line-height:130%;
|
||||
margin:0 0 0 8px !important;
|
||||
padding:8px 10px 9px;
|
||||
position:absolute;
|
||||
top:0;
|
||||
visibility:hidden;
|
||||
width:42%;
|
||||
z-index:1000;
|
||||
}
|
||||
|
||||
#esl_main_body form .guidelines small,#esr_main_body form .guidelines small
|
||||
{
|
||||
font-size:105%;
|
||||
}
|
||||
|
||||
#esl_main_body form li.highlighted .guidelines,#esr_main_body form li.highlighted .guidelines
|
||||
{
|
||||
visibility:visible;
|
||||
}
|
||||
|
||||
#esl_main_body form li:hover .guidelines,#esr_main_body form li:hover .guidelines
|
||||
{
|
||||
visibility:visible;
|
||||
}
|
||||
|
||||
.no_guidelines .guidelines
|
||||
{
|
||||
display:none !important;
|
||||
}
|
||||
|
||||
.no_guidelines form li
|
||||
{
|
||||
width:97%;
|
||||
}
|
||||
|
||||
.no_guidelines li.section
|
||||
{
|
||||
padding-left:9px;
|
||||
}
|
||||
|
||||
|
||||
/** Integrated Form **/
|
||||
.integrated *{
|
||||
font-family:"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.integrated #top, .integrated #bottom, .integrated h1{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.integrated #esl_form_container,.integrated #esr_form_container{
|
||||
border: none;
|
||||
width: 100%;
|
||||
background: none;
|
||||
|
||||
}
|
||||
|
||||
.integrated #footer{
|
||||
text-align: left;
|
||||
padding-left: 10px;
|
||||
width: 99%;
|
||||
}
|
||||
|
||||
.integrated #footer.success{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.integrated form.appnitro
|
||||
{
|
||||
margin:0px 0px 0;
|
||||
|
||||
}
|
||||
|
||||
.integrated form .section_break h3
|
||||
{
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.integrated #error_message h3
|
||||
{
|
||||
border: none !important;
|
||||
|
||||
}
|
||||
|
||||
526
email_settings.php
Normal file
@ -0,0 +1,526 @@
|
||||
<?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/language.php');
|
||||
require('includes/check-session.php');
|
||||
require('includes/db-core.php');
|
||||
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
|
||||
form_name,
|
||||
form_email,
|
||||
esl_from_name,
|
||||
esl_from_email_address,
|
||||
esl_subject,
|
||||
esl_content,
|
||||
esl_plain_text,
|
||||
esr_email_address,
|
||||
esr_from_name,
|
||||
esr_from_email_address,
|
||||
esr_subject,
|
||||
esr_content,
|
||||
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']);
|
||||
$esl_from_email_address = htmlspecialchars($row['esl_from_email_address']);
|
||||
$esl_subject = htmlspecialchars($row['esl_subject']);
|
||||
$esl_content = htmlspecialchars($row['esl_content'],ENT_NOQUOTES);
|
||||
$esl_plain_text = htmlspecialchars($row['esl_plain_text']);
|
||||
$esr_email_address = htmlspecialchars($row['esr_email_address']);
|
||||
$esr_from_name = htmlspecialchars($row['esr_from_name']);
|
||||
$esr_from_email_address = htmlspecialchars($row['esr_from_email_address']);
|
||||
$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
|
||||
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_position asc";
|
||||
$result = do_query($query);
|
||||
$i=0;
|
||||
$email_fields = array();
|
||||
while($row = do_fetch_result($result)){
|
||||
$email_fields[$i]['label'] = $row['element_title'];
|
||||
$email_fields[$i]['value'] = $row['element_id'];
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
//start left form handler --------
|
||||
if(NOTIFICATION_MAIL_FROM != ''){
|
||||
$esl_email_fields[0]['label'] = NOTIFICATION_MAIL_FROM;
|
||||
$esl_email_fields[0]['value'] = NOTIFICATION_MAIL_FROM;
|
||||
}else{
|
||||
$domain = str_replace('www.','',$_SERVER['SERVER_NAME']);
|
||||
$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'];
|
||||
$esl_input['esl_from_name'] = $input_array['esl_from_name'];
|
||||
$esl_input['esl_from_email_address'] = $input_array['esl_from_email_address'];
|
||||
$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
|
||||
$update_values
|
||||
where
|
||||
form_id='{$form_id}';";
|
||||
|
||||
do_query($query);
|
||||
|
||||
$_SESSION['AP_SUCCESS']['title'] = 'Success';
|
||||
$_SESSION['AP_SUCCESS']['desc'] = 'Notification settings have been saved.';
|
||||
|
||||
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 != ''){
|
||||
$_POST['esl_from_name'] = NOTIFICATION_MAIL_FROM_NAME;
|
||||
}else{
|
||||
$_POST['esl_from_name'] = 'MachForm';
|
||||
}
|
||||
|
||||
$_POST['esl_from_email_address'] = $esl_from_email_address;
|
||||
|
||||
if(!empty($esl_subject)){
|
||||
$_POST['esl_subject'] = $esl_subject;
|
||||
}elseif (NOTIFICATION_MAIL_SUBJECT != ''){
|
||||
$_POST['esl_subject'] = NOTIFICATION_MAIL_SUBJECT;
|
||||
}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'];
|
||||
$esr_input['esr_from_name'] = $input_array['esr_from_name'];
|
||||
$esr_input['esr_from_email_address'] = $input_array['esr_from_email_address'];
|
||||
$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
|
||||
$update_values
|
||||
where
|
||||
form_id='{$form_id}';";
|
||||
|
||||
do_query($query);
|
||||
|
||||
$_SESSION['AP_SUCCESS']['title'] = 'Success';
|
||||
$_SESSION['AP_SUCCESS']['desc'] = 'Notification settings have been saved.';
|
||||
|
||||
header("Location: email_settings.php?id={$form_id}");
|
||||
exit;
|
||||
}else{
|
||||
$_SESSION['AP_ERROR']['title'] = $lang['error_title'];
|
||||
$_SESSION['AP_ERROR']['desc'] = $lang['error_desc'];
|
||||
$_POST['esr_options_expand'] = 1;
|
||||
}
|
||||
}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 != ''){
|
||||
$_POST['esr_from_name'] = NOTIFICATION_MAIL_FROM_NAME;
|
||||
}else{
|
||||
$_POST['esr_from_name'] = 'MachForm';
|
||||
}
|
||||
|
||||
if(!empty($esr_from_email_address)){
|
||||
$_POST['esr_from_email_address'] = $esr_from_email_address;
|
||||
}elseif(NOTIFICATION_MAIL_FROM != ''){
|
||||
$_POST['esr_from_email_address'] = NOTIFICATION_MAIL_FROM;
|
||||
}else{
|
||||
$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"){
|
||||
$(".esl_options").slideDown("slow");
|
||||
$("#esl_toggle").text("hide options");
|
||||
$("#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_img").attr("src","images/icons/resultset_next.gif");
|
||||
$("#esl_options_expand").val("0");
|
||||
}
|
||||
}
|
||||
|
||||
function toggle_esr_options(){
|
||||
if($("#esr_toggle").text() == "more options"){
|
||||
$(".esr_options").slideDown("slow");
|
||||
$("#esr_toggle").text("hide options");
|
||||
$("#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_img").attr("src","images/icons/resultset_next.gif");
|
||||
$("#esr_options_expand").val("0");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{$esl_style}
|
||||
{$esr_style}
|
||||
EOT;
|
||||
?>
|
||||
|
||||
<?php require('includes/header.php'); ?>
|
||||
|
||||
<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</h2>
|
||||
<p>Configure your email notification settings</b></p>
|
||||
</div>
|
||||
<h2 style="font-size: 150%;margin-bottom: 10px;">Send notification emails to <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" />You</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">Your Email Address </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>
|
||||
<?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" /> Email Header</h3>
|
||||
</li>
|
||||
<li id="esl_li_3" class="esl_options">
|
||||
<label class="description" for="esl_from_name">From Name </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>
|
||||
<li id="esl_li_4" class="esl_options">
|
||||
<label class="description" for="esl_from_email_address">From Email address </label>
|
||||
<div>
|
||||
<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']){
|
||||
$selected = 'selected="selected"';
|
||||
}else{
|
||||
$selected = '';
|
||||
}
|
||||
echo "<option value=\"{$data['value']}\" {$selected}>{$data['label']}</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</li>
|
||||
<li id="esl_li_5" class="section_break esl_options">
|
||||
<h3><img src="images/icons/mail_reply_16.gif" align="absmiddle"/> Email Content</h3>
|
||||
</li>
|
||||
<li id="esl_li_6" class="esl_options">
|
||||
<label class="description" for="esl_subject">Subject </label>
|
||||
<div>
|
||||
<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">Content </label>
|
||||
<div>
|
||||
<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>
|
||||
<input id="esl_plain_text" name="esl_plain_text" class="element checkbox" type="checkbox" value="1" <?php if($_POST['esl_plain_text'] == 1){ echo 'checked="checked"'; } ?>/>
|
||||
<label class="choice" for="esl_plain_text">Send emails in simple text format</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/> You can insert <a href="template_variables.php?id=<?php echo $_REQUEST['id']; ?>" style="color: blue; border-bottom: 1px dotted #000;text-decoration: none">template variables</a> into the above fields.
|
||||
</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 'more options';} ?></a> <img align="absmiddle" src="images/icons/resultset_next.gif" id="esl_toggle_img"/>
|
||||
</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 id="esl_submit" class="button_text" type="submit" name="esl_submit" value="Save Changes" />
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- end left form -->
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div style="width: 50%;float: left; border-left: 2px dashed #ccc">
|
||||
<h2 style="font-size: 150%; margin-left: 20px"><img src="images/icons/agt_family_48.gif" align="absmiddle" /> Your Users</h2>
|
||||
<div id="es_right">
|
||||
|
||||
<!-- 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">Send To </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>
|
||||
<?php
|
||||
foreach ($esr_email_fields as $data){
|
||||
if($_POST['esr_email_address'] == $data['value']){
|
||||
$selected = 'selected="selected"';
|
||||
}else{
|
||||
$selected = '';
|
||||
}
|
||||
echo "<option value=\"{$data['value']}\" {$selected}>{$data['label']}</option>";
|
||||
}
|
||||
?>
|
||||
</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 email field found</label>
|
||||
<div>
|
||||
To enable sending email to your users, an Email field is required on the form.
|
||||
</div>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<li class="section_break esr_options">
|
||||
<h3><img src="images/icons/agt_utilities.gif" align="absmiddle" /> Email Header</h3>
|
||||
</li>
|
||||
<li id="esr_li_2" class="esr_options">
|
||||
<label class="description" for="esr_from_name">From Name </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>
|
||||
<li id="esr_li_3" class="esr_options<?php if(!$esr_valid_email){ echo ' error'; } ?>" >
|
||||
<label class="description" for="esr_from_email_address">From Email address </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>
|
||||
<?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"/> Email Content</h3>
|
||||
</li>
|
||||
<li id="esr_li_4" class="esr_options">
|
||||
<label class="description" for="esr_subject">Subject </label>
|
||||
<div>
|
||||
<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">Content </label>
|
||||
<div>
|
||||
<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>
|
||||
<input id="esr_plain_text" name="esr_plain_text" class="element checkbox" type="checkbox" value="1" <?php if($_POST['esr_plain_text'] == 1){ echo 'checked="checked"'; } ?>/>
|
||||
<label class="choice" for="esr_plain_text">Send emails in simple text format</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/> You can insert <a href="template_variables.php?id=<?php echo $_REQUEST['id']; ?>" style="color: blue; border-bottom: 1px dotted #000;text-decoration: none">template variables</a> into the above fields.
|
||||
</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 'more options';} ?></a> <img align="absmiddle" src="images/icons/resultset_next.gif" id="esr_toggle_img"/>
|
||||
<?php } ?>
|
||||
</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="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="Save Changes" <?php if(empty($esr_email_fields)){ echo 'disabled="disabled"'; } ?>/>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- end right form -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div style="clear: both; height: 20px"></div>
|
||||
</div>
|
||||
<?php require('includes/footer.php'); ?>
|
||||
94
embed.php
Normal file
@ -0,0 +1,94 @@
|
||||
<?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');
|
||||
require('includes/common-validator.php');
|
||||
require('includes/view-functions.php');
|
||||
require('includes/post-functions.php');
|
||||
require('includes/filter-functions.php');
|
||||
require('includes/entry-functions.php');
|
||||
require('includes/helper-functions.php');
|
||||
require('hooks/custom_hooks.php');
|
||||
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");
|
||||
exit;
|
||||
}else{
|
||||
echo "<script type=\"text/javascript\">top.location = '{$submit_result['form_redirect']}'</script>";
|
||||
exit;
|
||||
}
|
||||
}else{ //redirect to review page
|
||||
$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_embed.php?id={$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,0,true);
|
||||
}
|
||||
}else{ //if password form submitted
|
||||
if($submit_result['status'] === true){ //on success, display the form
|
||||
$markup = display_form($input_array['form_id'],null,null,'',0,true);
|
||||
}else{
|
||||
$custom_error = $submit_result['custom_error']; //error, display the pasword form again
|
||||
$markup = display_form($input_array['form_id'],null,null,$custom_error,0,true);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$form_id = (int) 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,true);
|
||||
}else{
|
||||
$markup = display_form($form_id,null,null,'',0,true);
|
||||
}
|
||||
}
|
||||
|
||||
header("Content-Type: text/html; charset=UTF-8");
|
||||
echo $markup;
|
||||
|
||||
?>
|
||||
159
embed_code.php
Normal file
@ -0,0 +1,159 @@
|
||||
<?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');
|
||||
require('includes/db-functions.php');
|
||||
require('includes/helper-functions.php');
|
||||
require('lib/pear/Compat/Function/file_put_contents.php');
|
||||
|
||||
connect_db();
|
||||
|
||||
$form_id = (int) trim($_REQUEST['id']);
|
||||
|
||||
|
||||
//get form detail
|
||||
$query = "select form_name,form_frame_height,form_captcha from `ap_forms` where form_id='$form_id'";
|
||||
$result = do_query($query);
|
||||
$row = do_fetch_result($result);
|
||||
$form_name = $row['form_name'];
|
||||
|
||||
if(empty($row['form_captcha'])){
|
||||
$frame_height = $row['form_frame_height'] + 80;
|
||||
}else{
|
||||
$frame_height = $row['form_frame_height'] + 250;
|
||||
}
|
||||
|
||||
$page_name = 'embed_code';
|
||||
|
||||
$ssl_suffix = get_ssl_suffix();
|
||||
|
||||
//construct standard form code
|
||||
$standard_form_code = '<iframe height="'.$frame_height.'" allowTransparency="true" frameborder="0" scrolling="no" style="width:100%;border:none" src="http'.$ssl_suffix.'://'.$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\').'/embed.php?id='.$form_id.'" title="'.$form_name.'"><a href="http'.$ssl_suffix.'://'.$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\').'/view.php?id='.$form_id.'" title="'.$form_name.'">'.$form_name.'</a></iframe>';
|
||||
|
||||
$form_link_code = '<a href="http'.$ssl_suffix.'://'.$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\').'/view.php?id='.$form_id.'" title="'.$form_name.'">'.$form_name.'</a>';
|
||||
|
||||
|
||||
$current_dir = rtrim(dirname($_SERVER['PHP_SELF']));
|
||||
if($current_dir == "/" || $current_dir == "\\"){
|
||||
$current_dir = '';
|
||||
}
|
||||
|
||||
$absolute_dir_path = rtrim(dirname($_SERVER['SCRIPT_FILENAME']));
|
||||
|
||||
$advanced_form_code =<<<EOT
|
||||
<?php
|
||||
require("{$absolute_dir_path}/machform.php");
|
||||
\$mf_param['form_id'] = {$form_id};
|
||||
\$mf_param['base_path'] = 'http{$ssl_suffix}://{$_SERVER['HTTP_HOST']}{$current_dir}/';
|
||||
display_machform(\$mf_param);
|
||||
?>
|
||||
EOT;
|
||||
|
||||
$header_data =<<<EOT
|
||||
<script type="text/javascript" src="js/jquery/jquery-core.js"></script>
|
||||
<link rel="stylesheet" href="css/jquery-tabs.css" type="text/css" media="screen">
|
||||
<script type="text/javascript" src="js/jquery/jquery-tabs.js"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$("#embed_code_tabs > ul").tabs({fx: {opacity: 'toggle' }});
|
||||
});
|
||||
</script>
|
||||
EOT;
|
||||
?>
|
||||
|
||||
<?php require('includes/header.php'); ?>
|
||||
|
||||
<div id="form_manager" style="padding-bottom: 50px;">
|
||||
<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" /> Embed Code</h2>
|
||||
<p>Copy and paste one of the code below into your website</p>
|
||||
</div>
|
||||
<div id="embed_code_tabs" class="flora">
|
||||
<ul>
|
||||
|
||||
<li><a href="#fragment-1"><span>Standard Form Code</span></a></li>
|
||||
<li><a href="#fragment-2"><span>Advanced Form Code</span></a></li>
|
||||
<li><a href="#fragment-3"><span>Simple Link</span></a></li>
|
||||
</ul>
|
||||
<div id="fragment-1">
|
||||
<img align="bottom" src="images/icons/resultset_down.gif" style="position: relative; margin-top: -10px; left: 60px;"/>
|
||||
<form id="form_edit_css" class="appnitro" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
|
||||
<ul>
|
||||
<li class="highlighted">
|
||||
<label class="desc" for="css_data">Standard Form Code:</label>
|
||||
<div>
|
||||
<textarea id="css_data" name="css_data" class="element textarea small" onclick="javascript: this.select()"><?php echo $standard_form_code; ?></textarea>
|
||||
<div style="padding-bottom: 10px;padding-top:10px; color: #444444;font-size:95%">
|
||||
<img src="images/icons/flag_green.gif" align="absmiddle" /> Use this code to embed your form to any page of your website or blog.<br /><br />
|
||||
<img src="images/icons/information.gif" align="absmiddle" /> <b>Instructions</b><br />
|
||||
<span style="color:#999999">
|
||||
<p style="padding-top: 5px;">1. Copy and paste the code into your web page.</p>
|
||||
<p style="padding-top: 5px;">2. Publish the file on your server.</p>
|
||||
<p style="padding-top: 5px;">3. Adjust the "height" variable of the iframe as needed.</p>
|
||||
<p style="padding-top: 5px;">4. Adjust your form CSS file to match your website style as needed.</p>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div id="fragment-2">
|
||||
<img align="bottom" src="images/icons/resultset_down.gif" style="position: relative; margin-top: -10px; left: 220px;"/>
|
||||
<form id="form_edit_css" class="appnitro" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
|
||||
<ul>
|
||||
<li class="highlighted">
|
||||
<label class="desc" for="css_data">Advanced Form Code:</label>
|
||||
<div>
|
||||
<textarea id="css_data" name="css_data" class="element textarea small" onclick="javascript: this.select()"><?php echo $advanced_form_code; ?></textarea>
|
||||
<div style="padding-bottom: 10px;padding-top:10px; color: #444444;font-size:95%">
|
||||
<img src="images/icons/flag_red.gif" align="absmiddle" /> This is for advanced user only. Use this code to integrate your form into your *.php pages without using iframe. Some PHP and CSS knowledge might be required.<br /><br />
|
||||
<img src="images/icons/information.gif" align="absmiddle" /> <b>Instructions</b><br />
|
||||
<span style="color:#999999">
|
||||
<p style="padding-top: 5px;">1. Copy and paste the code into your PHP page.</p>
|
||||
<p style="padding-top: 5px;">2. Publish the file on your server.</p>
|
||||
<p style="padding-top: 5px;">3. Adjust the CSS of your form to match your current page.</p>
|
||||
<p style="padding-top: 5px;">4. This code might not work on certain PHP page, thus it's not guaranteed to work on all pages. In case of failure, use Standard Form Code instead.</p>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
<div id="fragment-3">
|
||||
<img align="bottom" src="images/icons/resultset_down.gif" style="position: relative; margin-top: -10px; left: 345px;"/>
|
||||
<form id="form_edit_css" class="appnitro" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
|
||||
<ul>
|
||||
<li class="highlighted">
|
||||
<label class="desc" for="css_data">Simple Link:</label>
|
||||
<div>
|
||||
<textarea id="css_data" name="css_data" class="element textarea small" onclick="javascript: this.select()"><?php echo $form_link_code; ?></textarea>
|
||||
<div style="padding-bottom: 10px;padding-top:10px; color: #444444;font-size:95%">
|
||||
<img src="images/icons/flag_green.gif" align="absmiddle" /> Use this code to provide a link to your complete form.<br /><br />
|
||||
<img src="images/icons/information.gif" align="absmiddle" /> <b>Instructions</b><br />
|
||||
<span style="color:#999999">
|
||||
<p style="padding-top: 5px;">1. Copy and paste the code into your PHP page.</p>
|
||||
<p style="padding-top: 5px;">2. Publish the file on your server.</p>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</form> <br /><br />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<?php require('includes/footer.php'); ?>
|
||||
417
export_entries.php
Normal file
@ -0,0 +1,417 @@
|
||||
<?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();
|
||||
|
||||
ini_set("include_path", './lib/pear/'.PATH_SEPARATOR.ini_get("include_path"));
|
||||
ini_set("max_execution_time",1800);
|
||||
|
||||
|
||||
require('config.php');
|
||||
require('includes/language.php');
|
||||
require('includes/check-session.php');
|
||||
require('includes/db-core.php');
|
||||
|
||||
connect_db();
|
||||
|
||||
$form_id = (int) trim($_GET['id']);
|
||||
$type = trim($_GET['type']);
|
||||
|
||||
if(empty($form_id)){
|
||||
die("Invalid form ID.");
|
||||
}
|
||||
|
||||
|
||||
|
||||
//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'];
|
||||
|
||||
//get form element options
|
||||
$query = "select element_id,option_id,`option` from ap_element_options where form_id='$form_id' and live=1";
|
||||
$result = do_query($query);
|
||||
while($row = do_fetch_result($result)){
|
||||
$element_id = $row['element_id'];
|
||||
$option_id = $row['option_id'];
|
||||
|
||||
$element_option_lookup[$element_id][$option_id] = $row['option'];
|
||||
}
|
||||
|
||||
/******************************************************************************************/
|
||||
//prepare column header names lookup
|
||||
$query = "select element_id,element_title,element_type,element_constraint from `ap_form_elements` where form_id='$form_id' order by element_position asc";
|
||||
$result = do_query($query);
|
||||
|
||||
while($row = do_fetch_result($result)){
|
||||
$element_type = $row['element_type'];
|
||||
$element_constraint = $row['element_constraint'];
|
||||
|
||||
|
||||
if('address' == $element_type){ //address has 6 fields
|
||||
$column_name_lookup['element_'.$row['element_id'].'_1'] = $row['element_title'].' - '.$lang['address_street'];
|
||||
$column_name_lookup['element_'.$row['element_id'].'_2'] = $lang['address_street2'];
|
||||
$column_name_lookup['element_'.$row['element_id'].'_3'] = $lang['address_city'];
|
||||
$column_name_lookup['element_'.$row['element_id'].'_4'] = $lang['address_state'];
|
||||
$column_name_lookup['element_'.$row['element_id'].'_5'] = $lang['address_zip'];
|
||||
$column_name_lookup['element_'.$row['element_id'].'_6'] = $lang['address_country'];
|
||||
|
||||
$column_type_lookup['element_'.$row['element_id'].'_1'] = $row['element_type'];
|
||||
$column_type_lookup['element_'.$row['element_id'].'_2'] = $row['element_type'];
|
||||
$column_type_lookup['element_'.$row['element_id'].'_3'] = $row['element_type'];
|
||||
$column_type_lookup['element_'.$row['element_id'].'_4'] = $row['element_type'];
|
||||
$column_type_lookup['element_'.$row['element_id'].'_5'] = $row['element_type'];
|
||||
$column_type_lookup['element_'.$row['element_id'].'_6'] = $row['element_type'];
|
||||
|
||||
}elseif ('simple_name' == $element_type){ //simple name has 2 fields
|
||||
$column_name_lookup['element_'.$row['element_id'].'_1'] = $row['element_title'].' - '.$lang['name_first'];
|
||||
$column_name_lookup['element_'.$row['element_id'].'_2'] = $row['element_title'].' - '.$lang['name_last'];
|
||||
|
||||
$column_type_lookup['element_'.$row['element_id'].'_1'] = $row['element_type'];
|
||||
$column_type_lookup['element_'.$row['element_id'].'_2'] = $row['element_type'];
|
||||
|
||||
}elseif ('name' == $element_type){ //name has 4 fields
|
||||
$column_name_lookup['element_'.$row['element_id'].'_1'] = $row['element_title'].' - '.$lang['name_title'];
|
||||
$column_name_lookup['element_'.$row['element_id'].'_2'] = $row['element_title'].' - '.$lang['name_first'];
|
||||
$column_name_lookup['element_'.$row['element_id'].'_3'] = $row['element_title'].' - '.$lang['name_last'];
|
||||
$column_name_lookup['element_'.$row['element_id'].'_4'] = $row['element_title'].' - '.$lang['name_suffix'];
|
||||
|
||||
$column_type_lookup['element_'.$row['element_id'].'_1'] = $row['element_type'];
|
||||
$column_type_lookup['element_'.$row['element_id'].'_2'] = $row['element_type'];
|
||||
$column_type_lookup['element_'.$row['element_id'].'_3'] = $row['element_type'];
|
||||
$column_type_lookup['element_'.$row['element_id'].'_4'] = $row['element_type'];
|
||||
|
||||
}elseif('money' == $element_type){//money format
|
||||
$column_name_lookup['element_'.$row['element_id']] = $row['element_title'];
|
||||
if(!empty($element_constraint)){
|
||||
$column_type_lookup['element_'.$row['element_id']] = $element_constraint; //euro, pound, yen
|
||||
}else{
|
||||
$column_type_lookup['element_'.$row['element_id']] = 'dollar'; //default is dollar
|
||||
}
|
||||
}elseif('checkbox' == $element_type){ //checkboxes, get childs elements
|
||||
|
||||
$this_checkbox_options = $element_option_lookup[$row['element_id']];
|
||||
foreach ($this_checkbox_options as $option_id=>$option){
|
||||
$column_name_lookup['element_'.$row['element_id'].'_'.$option_id] = $option;
|
||||
$column_type_lookup['element_'.$row['element_id'].'_'.$option_id] = $row['element_type'];
|
||||
}
|
||||
}elseif ('time' == $element_type){
|
||||
if($element_constraint == 'show_seconds'){
|
||||
$column_type_lookup['element_'.$row['element_id']] = $row['element_type'];
|
||||
}else{
|
||||
$column_type_lookup['element_'.$row['element_id']] = 'time_noseconds';
|
||||
}
|
||||
|
||||
$column_name_lookup['element_'.$row['element_id']] = $row['element_title'];
|
||||
}else{ //for other elements with only 1 field
|
||||
$column_name_lookup['element_'.$row['element_id']] = $row['element_title'];
|
||||
$column_type_lookup['element_'.$row['element_id']] = $row['element_type'];
|
||||
}
|
||||
}
|
||||
/******************************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
//set column properties for basic fields
|
||||
$column_name_lookup['id'] = $lang['export_num'];
|
||||
$column_name_lookup['date_created'] = $lang['date_created'];
|
||||
$column_name_lookup['date_updated'] = $lang['date_updated'];
|
||||
$column_name_lookup['ip_address'] = $lang['ip_address'];
|
||||
|
||||
$column_type_lookup['id'] = 'number';
|
||||
$column_type_lookup['date_created'] = 'text';
|
||||
$column_type_lookup['date_updated'] = 'text';
|
||||
$column_type_lookup['ip_address'] = 'text';
|
||||
|
||||
|
||||
/******************************************************************************************/
|
||||
//prepare headers
|
||||
if($type == 'xls'){
|
||||
require('Spreadsheet/Excel/Writer.php');
|
||||
|
||||
// Creating a workbook
|
||||
$workbook = new Spreadsheet_Excel_Writer();
|
||||
|
||||
$workbook->setTempDir(DATA_DIR);
|
||||
|
||||
// sending HTTP headers
|
||||
$clean_form_name = preg_replace("/[^A-Za-z0-9_-]/","",$form_name);
|
||||
$workbook->send("{$clean_form_name}.xls");
|
||||
|
||||
if(function_exists('iconv')){
|
||||
$workbook->setVersion(8);
|
||||
}
|
||||
|
||||
// Creating a worksheet
|
||||
$clean_form_name = substr($clean_form_name,0,30); //must be less than 31 characters
|
||||
$worksheet =& $workbook->addWorksheet($clean_form_name);
|
||||
|
||||
$format_bold =& $workbook->addFormat();
|
||||
$format_bold->setBold();
|
||||
$format_bold->setFgColor(22);
|
||||
$format_bold->setPattern(1);
|
||||
$format_bold->setBorder(1);
|
||||
|
||||
if(function_exists('iconv')){
|
||||
$worksheet->setInputEncoding('UTF-8');
|
||||
}
|
||||
|
||||
$format_wrap = $workbook->addFormat();
|
||||
$format_wrap->setTextWrap();
|
||||
|
||||
}elseif ($type == 'csv'){
|
||||
require('Compat/Function/fputcsv.php');
|
||||
|
||||
$clean_form_name = preg_replace("/[^A-Za-z0-9_-]/","",$form_name);
|
||||
|
||||
//Prepare headers
|
||||
header("Pragma: public");
|
||||
header("Expires: 0");
|
||||
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
|
||||
header("Cache-Control: public", false);
|
||||
header("Content-Description: File Transfer");
|
||||
header("Content-Type: application/vnd.ms-excel");
|
||||
header("Content-Disposition: attachment; filename=\"{$clean_form_name}.csv\"");
|
||||
|
||||
$out = fopen('php://output', 'w');
|
||||
}
|
||||
|
||||
/******************************************************************************************/
|
||||
|
||||
//get column labels, order in the correct position
|
||||
$query = "select * from `ap_form_{$form_id}` limit 1"; //limit 1 being used so that we could get the headers
|
||||
$result = do_query($query);
|
||||
|
||||
//get actual field name from selected table
|
||||
$i = 0;
|
||||
$fields_num = mysql_num_fields($result);
|
||||
while($i < $fields_num){
|
||||
$meta = mysql_fetch_field($result, $i);
|
||||
$columns[$i] = $meta->name;
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
$temp_columns = array_slice($columns,0,4);
|
||||
|
||||
//first, reorder columns into the correct position
|
||||
$query = "select
|
||||
element_id,
|
||||
element_total_child,
|
||||
element_type
|
||||
from
|
||||
`ap_form_elements`
|
||||
where
|
||||
form_id='$form_id' and element_type != 'section'
|
||||
order by
|
||||
element_position asc";
|
||||
$result = do_query($query);
|
||||
|
||||
while($row = do_fetch_result($result)){
|
||||
$element_id = $row['element_id'];
|
||||
$total_child = $row['element_total_child'];
|
||||
$element_type = $row['element_type'];
|
||||
|
||||
if($total_child > 0){
|
||||
if($element_type != 'checkbox'){
|
||||
$max = $total_child + 1;
|
||||
for($i=0;$i<=$max;$i++){
|
||||
if($i == 0){
|
||||
if(in_array('element_'.$element_id,$columns)){
|
||||
$temp_columns[] = 'element_'.$element_id;
|
||||
}
|
||||
}else{
|
||||
|
||||
if(in_array('element_'.$element_id.'_'.$i,$columns)){
|
||||
$temp_columns[] = 'element_'.$element_id.'_'.$i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}elseif ($element_type == 'checkbox'){
|
||||
$checkbox_child_query = "select
|
||||
`option_id`
|
||||
from
|
||||
`ap_element_options`
|
||||
where
|
||||
form_id='{$form_id}' and element_id='{$element_id}' and live=1
|
||||
order by
|
||||
position asc";
|
||||
$checkbox_child_result = do_query($checkbox_child_query);
|
||||
while($check_child_row = do_fetch_result($checkbox_child_result)){
|
||||
$option_id = $check_child_row['option_id'];
|
||||
if(in_array('element_'.$element_id.'_'.$option_id,$columns)){
|
||||
$temp_columns[] = 'element_'.$element_id.'_'.$option_id;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}else{
|
||||
|
||||
if($element_type != 'checkbox'){
|
||||
$temp_columns[] = 'element_'.$element_id;
|
||||
}else{
|
||||
$temp_columns[] = 'element_'.$element_id.'_1';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$columns = array();
|
||||
$columns = $temp_columns;
|
||||
|
||||
|
||||
/******************************************************************************************/
|
||||
//get form entries
|
||||
$query = "select * from `ap_form_{$form_id}` order by id asc";
|
||||
$result = do_query($query);
|
||||
|
||||
$i=0;
|
||||
$i_file=0;
|
||||
$c=0;
|
||||
$row_num = 1;
|
||||
$column_label = array();
|
||||
$column_label_has_printed = false;
|
||||
|
||||
while($row = do_fetch_result($result)){
|
||||
|
||||
for($j=0;$j<$fields_num;$j++){
|
||||
|
||||
$column_name = $columns[$j];
|
||||
|
||||
if(count($column_label) < $fields_num){
|
||||
$column_label[$c] = $column_name_lookup[$column_name];
|
||||
$c++;
|
||||
}
|
||||
|
||||
//initialize with empty value, so it won't break our grid
|
||||
$form_data[$i][$j] = '';
|
||||
|
||||
if($column_type_lookup[$column_name] == 'time'){
|
||||
$form_data[$i][$j] = date("h:i:s A",strtotime($row[$column_name]));
|
||||
}elseif($column_type_lookup[$column_name] == 'time_noseconds'){
|
||||
if(!empty($row[$column_name])){
|
||||
$form_data[$i][$j] = date("h:i A",strtotime($row[$column_name]));
|
||||
}
|
||||
}elseif(in_array($column_type_lookup[$column_name],array('dollar','euro','pound','yen'))){ //set column formatting for money fields
|
||||
$form_data[$i][$j] = $row[$column_name];
|
||||
}elseif($column_type_lookup[$column_name] == 'date'){ //date with format MM/DD/YYYY
|
||||
if(!empty($row[$column_name]) && ($row[$column_name] != '0000-00-00')){
|
||||
$form_data[$i][$j] = date("Y/m/d",strtotime($row[$column_name]));
|
||||
}
|
||||
}elseif($column_type_lookup[$column_name] == 'europe_date'){ //date with format MM/DD/YYYY
|
||||
if(!empty($row[$column_name]) && ($row[$column_name] != '0000-00-00')){
|
||||
$form_data[$i][$j] = date("Y/m/d",strtotime($row[$column_name]));
|
||||
}
|
||||
}elseif($column_type_lookup[$column_name] == 'number'){
|
||||
$form_data[$i][$j] = $row[$column_name];
|
||||
}elseif (in_array($column_type_lookup[$column_name],array('radio','select'))){ //multiple choice or dropdown
|
||||
$exploded = array();
|
||||
$exploded = explode('_',$column_name);
|
||||
$this_element_id = $exploded[1];
|
||||
$this_option_id = $row[$column_name];
|
||||
|
||||
$form_data[$i][$j] = $element_option_lookup[$this_element_id][$this_option_id];
|
||||
}elseif($column_type_lookup[$column_name] == 'checkbox'){
|
||||
if(!empty($row[$column_name])){
|
||||
$form_data[$i][$j] = $column_label[$j];
|
||||
}
|
||||
}elseif(in_array($column_type_lookup[$column_name],array('phone','simple_phone'))){
|
||||
$form_data[$i][$j] = $row[$column_name];
|
||||
}elseif($column_type_lookup[$column_name] == 'file'){
|
||||
if(!empty($row[$column_name])){
|
||||
$filename_only = $row[$column_name];
|
||||
|
||||
//remove the element_x-xx- suffix we added to all uploaded files
|
||||
$file_1 = substr($filename_only,strpos($filename_only,'-')+1);
|
||||
$filename_only = substr($file_1,strpos($file_1,'-')+1);
|
||||
|
||||
$form_data[$i][$j] = $filename_only;
|
||||
|
||||
$q_string = base64_encode("form_id={$form_id}&id={$row['id']}&el={$column_name}");
|
||||
$file_url[$i_file][$j] = "http://".$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\')."/download.php?q={$q_string}";
|
||||
}
|
||||
|
||||
}else{
|
||||
$form_data[$i][$j] = $row[$column_name];
|
||||
}
|
||||
|
||||
if($j == 0){
|
||||
$form_data[$i][$j] = $row_num;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
$i_file++;
|
||||
//print_r($file_url);
|
||||
|
||||
if($type == 'xls'){
|
||||
//print column header
|
||||
if(!$column_label_has_printed){
|
||||
$i=0;
|
||||
foreach ($column_label as $label){
|
||||
$worksheet->write(0, $i, $label,$format_bold);
|
||||
$i++;
|
||||
}
|
||||
$column_label_has_printed = true;
|
||||
}
|
||||
|
||||
//print column data
|
||||
|
||||
foreach ($form_data as $row_data){
|
||||
$col_num = 0;
|
||||
foreach ($row_data as $data){
|
||||
//echo "rownum -1: ".($row_num - 1)."\n";
|
||||
//echo "colnum: ".$col_num."\n";
|
||||
if(empty($file_url[$row_num-1][$col_num])){
|
||||
$data = str_replace("\r","",$data);
|
||||
if($col_num > 4){
|
||||
$worksheet->write($row_num, $col_num, $data,$format_wrap);
|
||||
}else{
|
||||
$worksheet->write($row_num, $col_num, $data);
|
||||
}
|
||||
}else{
|
||||
$worksheet->writeUrl($row_num,$col_num,$file_url[$row_num-1][$col_num],$data);
|
||||
}
|
||||
$col_num++;
|
||||
}
|
||||
|
||||
}
|
||||
}elseif ($type == 'csv'){
|
||||
if(!$column_label_has_printed){
|
||||
fputcsv($out, $column_label);
|
||||
$column_label_has_printed = true;
|
||||
}
|
||||
|
||||
foreach ($form_data as $row_data){
|
||||
fputcsv($out, $row_data);
|
||||
}
|
||||
}
|
||||
|
||||
$row_num++;
|
||||
unset($form_data);
|
||||
unset($file_url);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************************/
|
||||
|
||||
//start exporting data
|
||||
if($type == 'xls'){
|
||||
// Let's send the file
|
||||
$workbook->close();
|
||||
|
||||
}elseif ($type == 'csv'){
|
||||
fclose($out);
|
||||
}
|
||||
|
||||
?>
|
||||
26
hooks/custom_hooks.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?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/
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
/** Hook samples **
|
||||
//sample customizing captcha look and feel
|
||||
function form2_hook_pre_captcha(){
|
||||
$capthca_theme =<<<EOT
|
||||
<script>
|
||||
var RecaptchaOptions = {
|
||||
theme : 'blackglass'
|
||||
};
|
||||
</script>
|
||||
EOT;
|
||||
return $capthca_theme;
|
||||
}
|
||||
|
||||
**/
|
||||
?>
|
||||
BIN
images/ap_bg.gif
Normal file
|
After Width: | Height: | Size: 49 B |
BIN
images/appnitro_logo.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
images/bottom.png
Normal file
|
After Width: | Height: | Size: 431 B |
BIN
images/button_icon/address_bg.gif
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
images/button_icon/checkbox_bg.gif
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/button_icon/date_bg.gif
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
images/button_icon/dropdown_bg.gif
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
images/button_icon/file_upload_bg.gif
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
images/button_icon/mail_bg.gif
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/button_icon/multiplechoice_bg.gif
Normal file
|
After Width: | Height: | Size: 379 B |
BIN
images/button_icon/name_bg.gif
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/button_icon/number_bg.gif
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/button_icon/paragraph_text_bg.gif
Normal file
|
After Width: | Height: | Size: 458 B |
BIN
images/button_icon/phone_bg.gif
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
images/button_icon/price_bg.gif
Normal file
|
After Width: | Height: | Size: 581 B |
BIN
images/button_icon/section_break_bg.gif
Normal file
|
After Width: | Height: | Size: 637 B |
BIN
images/button_icon/single_line_text_bg.gif
Normal file
|
After Width: | Height: | Size: 372 B |
BIN
images/button_icon/time_bg.gif
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
images/button_icon/website_bg.gif
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
images/button_text/address.gif
Normal file
|
After Width: | Height: | Size: 546 B |
BIN
images/button_text/checkboxes.gif
Normal file
|
After Width: | Height: | Size: 638 B |
BIN
images/button_text/date.gif
Normal file
|
After Width: | Height: | Size: 448 B |
BIN
images/button_text/drop_down.gif
Normal file
|
After Width: | Height: | Size: 576 B |
BIN
images/button_text/email.gif
Normal file
|
After Width: | Height: | Size: 456 B |
BIN
images/button_text/file_upload.gif
Normal file
|
After Width: | Height: | Size: 590 B |
BIN
images/button_text/multiple_choice.gif
Normal file
|
After Width: | Height: | Size: 688 B |
BIN
images/button_text/name.gif
Normal file
|
After Width: | Height: | Size: 474 B |
BIN
images/button_text/number.gif
Normal file
|
After Width: | Height: | Size: 509 B |
BIN
images/button_text/paragraph_text.gif
Normal file
|
After Width: | Height: | Size: 691 B |
BIN
images/button_text/phone.gif
Normal file
|
After Width: | Height: | Size: 478 B |
BIN
images/button_text/price.gif
Normal file
|
After Width: | Height: | Size: 462 B |
BIN
images/button_text/section_break.gif
Normal file
|
After Width: | Height: | Size: 671 B |
BIN
images/button_text/single_line_text.gif
Normal file
|
After Width: | Height: | Size: 697 B |
BIN
images/button_text/time.gif
Normal file
|
After Width: | Height: | Size: 437 B |
BIN
images/button_text/web_site.gif
Normal file
|
After Width: | Height: | Size: 579 B |
BIN
images/calendar.gif
Normal file
|
After Width: | Height: | Size: 634 B |
BIN
images/click_to_add.gif
Normal file
|
After Width: | Height: | Size: 1007 B |
BIN
images/create_new_form.gif
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
images/embed_code_tabs.gif
Normal file
|
After Width: | Height: | Size: 381 B |
BIN
images/exec.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
images/icons/add.gif
Normal file
|
After Width: | Height: | Size: 610 B |
BIN
images/icons/agt_family_48.gif
Normal file
|
After Width: | Height: | Size: 959 B |
BIN
images/icons/agt_utilities.gif
Normal file
|
After Width: | Height: | Size: 308 B |
BIN
images/icons/agt_utilities.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
images/icons/application_edit.gif
Normal file
|
After Width: | Height: | Size: 624 B |
BIN
images/icons/arrow.gif
Normal file
|
After Width: | Height: | Size: 654 B |
BIN
images/icons/arrow_left.gif
Normal file
|
After Width: | Height: | Size: 660 B |
BIN
images/icons/arrow_right.gif
Normal file
|
After Width: | Height: | Size: 201 B |
BIN
images/icons/arrow_turn_left.gif
Normal file
|
After Width: | Height: | Size: 224 B |
BIN
images/icons/asterisk_orange.gif
Normal file
|
After Width: | Height: | Size: 1019 B |
BIN
images/icons/attach.gif
Normal file
|
After Width: | Height: | Size: 560 B |
BIN
images/icons/calendar.gif
Normal file
|
After Width: | Height: | Size: 634 B |
BIN
images/icons/checkbox.gif
Normal file
|
After Width: | Height: | Size: 668 B |
BIN
images/icons/checkbox_16.gif
Normal file
|
After Width: | Height: | Size: 564 B |
BIN
images/icons/cog.gif
Normal file
|
After Width: | Height: | Size: 311 B |
BIN
images/icons/colorize_32.gif
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/icons/copy_32.gif
Normal file
|
After Width: | Height: | Size: 556 B |
BIN
images/icons/cross.gif
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/icons/cross_16.gif
Normal file
|
After Width: | Height: | Size: 644 B |
BIN
images/icons/cross_22.gif
Normal file
|
After Width: | Height: | Size: 405 B |
BIN
images/icons/date.gif
Normal file
|
After Width: | Height: | Size: 291 B |
BIN
images/icons/decrypted.gif
Normal file
|
After Width: | Height: | Size: 751 B |
BIN
images/icons/delete.gif
Normal file
|
After Width: | Height: | Size: 606 B |
BIN
images/icons/disabled.gif
Normal file
|
After Width: | Height: | Size: 816 B |
BIN
images/icons/duplicate.gif
Normal file
|
After Width: | Height: | Size: 636 B |
BIN
images/icons/edit_form_32.gif
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/icons/edit_user.gif
Normal file
|
After Width: | Height: | Size: 744 B |
BIN
images/icons/edit_user_48.gif
Normal file
|
After Width: | Height: | Size: 516 B |
BIN
images/icons/embed_code_32.gif
Normal file
|
After Width: | Height: | Size: 715 B |
BIN
images/icons/entries_32.gif
Normal file
|
After Width: | Height: | Size: 932 B |