Add php files
This commit is contained in:
48
modules/EcmPaymentStates/multiMatch.php
Executable file
48
modules/EcmPaymentStates/multiMatch.php
Executable file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
//add jquery
|
||||
echo '<link rel="stylesheet" type="text/css" href="include/jQuery/jquery-table/jquery.appendGrid-1.3.1.css"/>';
|
||||
echo '<link rel="stylesheet" type="text/css" href="include/jQuery/jquery-ui/themes/base/jquery-ui.css"/>';
|
||||
echo '<script type="text/javascript"
|
||||
src="include/jQuery/jquery-2.1.0.min.js"></script>';
|
||||
echo '<script type="text/javascript"
|
||||
src="include/jQuery/jquery-table/jquery.appendGrid-1.3.1.js"></script>';
|
||||
echo '<script type="text/javascript"
|
||||
src="include/jQuery/jquery-ui/ui/jquery-ui.js"></script>';
|
||||
|
||||
//create data arrays
|
||||
$left = explode("|", rtrim($_REQUEST['inv'],"|"));
|
||||
$right = explode("|", rtrim($_REQUEST['pay'],"|"));
|
||||
|
||||
//draw main table
|
||||
$a = new Account();
|
||||
$a->retrieve($_REQUEST['account_id']);
|
||||
$html = '<h1>'.$a->name.'</h1><br><table style="border: 1 px solid; width: 100%;">';
|
||||
unset($a);
|
||||
$html .= '<tr><td style="width: 50%;">Lewa<table id="left_site" style="width: 100%;"></table><div id="left_drop" style="width:100%; border: 2px dashed red;"> <br> </div></td><td>Prawa<table id="right_site" style="width: 100%"></table><div id="right_drop" style="width:100%; border: 2px dashed green;"> <br> </div></td></tr>';
|
||||
$html .= '<tr><td colspan="2" style="width: 100%;"><br><br></td></tr>';
|
||||
$html .= '<tr><td valign="top" align="center">';
|
||||
foreach ($left as $v) {
|
||||
$html.='<div id="draggable_'.$v.'" class="ui-widget-content" style="width: 90%; height: 30px; border: 1px dashed blue;"><p>'.getTransactionRow($v).'</p></div>';
|
||||
}
|
||||
$html.= '</td><td valign="top" align="center">';
|
||||
foreach ($right as $v) {
|
||||
$html.='<div id="draggable_'.$v.'" class="ui-widget-content" style="width: 90%; height: 30px; border: 1px dashed blue;"><p>'.getTransactionRow($v).'</p></div>';
|
||||
}
|
||||
$html.='</td></tr>';
|
||||
$html.= '</table>';
|
||||
//create jQuery functions
|
||||
$html.='
|
||||
<script src="modules/EcmPaymentStates/javascript/multiMatch.js"></script>
|
||||
';
|
||||
echo $html;
|
||||
|
||||
function getTransactionRow($id) {
|
||||
$t = new EcmTransaction();
|
||||
$t->retrieve($id);
|
||||
|
||||
$ret = '<table style="width: 100%"><tr><td style="width: 100px;"><p id="name">'.$t->name.'</p></td><td style="width: 15px;"><p id="date">'.$t->payment_date.'</p></td><td style="width: 15px;">'.$t->value.'</td><td style="width: 15px;"><input disabled type="text" value="'.$t->value.'"/></td></tr></table>';
|
||||
|
||||
unset($t);
|
||||
return $ret;
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user