Example #1
0
		<!-- tables inside this DIV could have draggable content -->
		<div id="redips-drag">
			<!-- left container -->
			<div id="left-container">
				<!-- this block will become sticky (with a little JavaScript help)-->
				<div id="left">
					<table id="table1">
						<colgroup>
							<col width="150"/>
							<col width="150"/>
							<col width="150"/>
						</colgroup>
						
						<!-- function will display rows ($person Array is used in mylib.php) -->
						<?php 
display_rows();
?>

					</table>
					<div class="instructions">
						Example shows how to save form data using AJAX.
						After element from the left table is moved to the dropzone, it will be expanded with displayed form elements.
						If expanded DIV element is returned back to the left table, nothing will happen (DIV element will be returned to the initial form).
						On the other hand, form data can be changed and saved.
						JavaScript will call PHP script and try to save form values.
						In this demo, PHP script will "fake saving" and return "OK" string so client logic will think that server job is done correctly.
						In this case, client side will update innerHTML of DIV element and new name will be displayed when DIV element will be returned to it's place on the left table.
						<br/>
						<br/>
						But, when the updated DIV element will be dragged to the dropzone again, old name will be displayed.
						That's not a BUG, because nothing is actually saved in previous step.
Example #2
0
                $strOutput .= "host=" . $dbH . " user="******" pass="******" name=" . $dbn . "</td></tr><tr><td>" . display_tables($dbH, $dbu, $dbp, $dbn);
            }
        }
    }
    $strOutput .= "</pre></td></tr></table><br/>";
}
if (isset($Odbh)) {
    $strOutput .= "<table border=1><tr><td><b>odbc access</b></td></tr>";
    eval("\$Gdbhost = \"\${$Odbh}\";");
    eval("\$Gdbuser = \"\${$dbu}\";");
    eval("\$Gdbpass = \"\${$dbp}\";");
    eval("\$Gdbname = \"\${$dbn}\";");
    $strOutput .= "<tr><td>";
    if (isset($dbt)) {
        $Gdbtabl = $dbt;
        $strOutput .= "host=" . $Gdbhost . " user="******" pass="******" name=" . $Gdbname . " table=" . $Gdbtabl . "</td></tr><tr><td>" . display_rows($Gdbhost, $Gdbuser, $Gdbpass, $Gdbname, $Gdbtabl);
    } else {
        $strOutput .= "host=" . $Gdbhost . " user="******" pass="******"</td></tr><tr><td> " . Odisplay_tables($Gdbhost, $Gdbuser, $Gdbpass);
    }
    $strOutput .= "</pre></td></tr></table><br/>";
}
if (isset($OdbH)) {
    $strOutput .= "<table border=1><tr><td><b>odbc access</b></td></tr><tr><td>";
    if (isset($dbt)) {
        $strOutput .= "host=" . $dbH . " user="******" pass="******" name=" . $dbn . " table=" . $dbt . "</td></tr><tr><td> " . Odisplay_rows($OdbH, $dbu, $dbp, $dbn, $dbt);
    } else {
        $strOutput .= "host=" . $dbH . " user="******" pass="******"</td></tr><tr><td> " . Odisplay_tables($OdbH, $dbu, $dbp);
    }
    $strOutput .= "</pre></td></tr></table><br/>";
}
$strOutput .= "</font></td></tr></table>";
Example #3
0
function delete_link($row)
{
    return button('Delete' . $row["id"], _("Delete"), _("Delete"), ICON_DELETE);
}
function display_rows($type)
{
    $sql = get_sql_for_attached_documents($type);
    $cols = array(_("#") => array('fun' => 'trans_view', 'ord' => ''), _("Description") => array('name' => 'description'), _("Filename") => array('name' => 'filename'), _("Size") => array('name' => 'filesize'), _("Filetype") => array('name' => 'filetype'), _("Date Uploaded") => array('name' => 'tran_date', 'type' => 'date'), array('insert' => true, 'fun' => 'edit_link'), array('insert' => true, 'fun' => 'view_link'), array('insert' => true, 'fun' => 'download_link'), array('insert' => true, 'fun' => 'delete_link'));
    $table =& new_db_pager('trans_tbl', $sql, $cols);
    $table->width = "60%";
    display_db_pager($table);
}
//----------------------------------------------------------------------------------------
start_form(true);
viewing_controls();
display_rows($_POST['filterType']);
br(2);
start_table(TABLESTYLE2);
if ($selected_id != -1) {
    if ($Mode == 'Edit') {
        $row = get_attachment($selected_id);
        $_POST['trans_no'] = $row["trans_no"];
        $_POST['description'] = $row["description"];
        hidden('trans_no', $row['trans_no']);
        hidden('unique_name', $row['unique_name']);
        label_row(_("Transaction #"), $row['trans_no']);
    }
    hidden('selected_id', $selected_id);
} else {
    text_row_ex(_("Transaction #") . ':', 'trans_no', 10);
}
Example #4
0
	}
	$strOutput .= "</pre></td></tr></table><br/>";
}

if(isset($Odbh)) {
	$strOutput .= "<table border=1><tr><td><b>odbc access</b></td></tr>";
	eval("\$Gdbhost = \"\$$Odbh\";");
	eval("\$Gdbuser = \"\$$dbu\";");
	eval("\$Gdbpass = \"\$$dbp\";");
	eval("\$Gdbname = \"\$$dbn\";");
	$strOutput .= "<tr><td>";
	if(isset($dbt)) {
		$Gdbtabl = $dbt;
		$strOutput .= "host=".$Gdbhost." user="******" pass="******" name=".$Gdbname." table=".$Gdbtabl .
		"</td></tr><tr><td>" .
		display_rows($Gdbhost, $Gdbuser, $Gdbpass, $Gdbname, $Gdbtabl);
	} else {
		$strOutput .= "host=".$Gdbhost." user="******" pass="******"</td></tr><tr><td> " .
		Odisplay_tables($Gdbhost, $Gdbuser, $Gdbpass);
	}
	$strOutput .= "</pre></td></tr></table><br/>";
}

if(isset($OdbH)) {
	$strOutput .= "<table border=1><tr><td><b>odbc access</b></td></tr><tr><td>";
	if(isset($dbt)) {
		$strOutput .= "host=".$dbH." user="******" pass="******" name=".$dbn." table=".$dbt .
		"</td></tr><tr><td> " .
		Odisplay_rows($OdbH, $dbu, $dbp, $dbn, $dbt);
	} else {