Esempio n. 1
0
function printDerangement($derangement, $settings)
{
    foreach ($settings->derangements as $m) {
        if ($derangement->id == $m->id) {
            printRow($derangement, $m);
        }
    }
}
Esempio n. 2
0
function printBalanceStatements($net)
{
    $receipts = sprintf("%.2f", runQuery("Select SUM(r_amount) as amt from f_receivables where r_date like '%2015%'", 'amt'));
    $payables = sprintf("%.2f", runQuery("Select SUM(p_amount) as amt from f_payables where p_date like '%2015%'", 'amt'));
    $gross = $net + $receipts - $payables;
    echo "<table class=ptables>\n";
    printRow("Mini Balance Sheet", '', '', 'H');
    printRow("Cash and Equivalents", '', $net);
    printRow("Accounts Receivables", '', $receipts);
    printRow("Accounts Payables", $payables, '');
    printRow("Net Assets", '', $gross, 'H');
    echo "</table>";
}
function echoInitialVersionRows($version)
{
    if ($version < 1) {
        printRow('Pre-v1.4.0');
    }
    if ($version < 140) {
        printRow('v1.4.0');
    }
    if ($version < 141) {
        printRow('v1.4.1');
    }
    if ($version < 150) {
        printRow('v1.5.0');
    }
    if ($version < 160) {
        printRow('v1.6.0');
    }
    if ($version < 161) {
        printRow('v1.6.1');
    }
    if ($version < 170) {
        printRow('v1.7.0');
    }
    if ($version < 200) {
        printRow('v2.0.0');
    }
    if ($version < 201) {
        printRow('v2.0.1');
    }
    if ($version < 210) {
        printRow('v2.1.0');
    }
    if ($version < 211) {
        printRow('v2.1.1');
    }
    if ($version < 220) {
        printRow('v2.2.0');
    }
    if ($version < 221) {
        printRow('v2.2.1');
    }
    if ($version < 230) {
        printRow('v2.3.0');
    }
    if ($version < 231) {
        printRow('v2.3.1');
    }
    if ($version < 232) {
        printRow('v2.3.2');
    }
}
Esempio n. 4
0
printRow($e_vals['HUMIDIFIER:ELECTRICITY']);
?>

		  </tr>
		  <tr class="table-row-even">
		    <th> Regrigeration
		    </th>
		     <?php 
printRow($e_vals['HEATRECOVERY:ELECTRICITY']);
?>
		  </tr>
 		  <tr class="table-row-even">
		    <th> Generation
		    </th>
		     <?php 
printRow($e_vals['HEATRECOVERY:ELECTRICITY']);
?>
		  </tr>
          </table>
    </div> <!-- /container -->

    <!-- Le javascript
    ================================================== -->

    <!-- load highchart libs -->
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
    <script src="js/Highcharts-3.0.4/js/highcharts.js"></script>
    <script src="js/Highcharts-3.0.4/js/modules/exporting.js"></script>
     <!-- Placed at the end of the document so the pages load faster -->
    <script type="text/javascript" src="js/bootstrap.min.js"></script>
Esempio n. 5
0
			<?php 
printRowHeader();
?>
			<?php 
printRow($bees, 'workers');
?>
			</table>
		</div>
		<div class="col-md-4">
			<h2>Drones</h2>
			<table class="table table-bordered table-responsive" width="100%">
			<?php 
printRowHeader();
?>
			<?php 
printRow($bees, 'drone');
?>
			</table>
		</div>
	</div>

	<div class="text-center">
		<form action="javascript:void(0)" method="post" role="form">
			<button type="button" id="hit-button" class="btn btn-primary">Hit!</button>
			<button type="button" id="reset-button" class="btn btn-danger">Reset</button>
		</form>
	</div>

	<br>

	<div id="result"></div>
function htmlPrinter($endpoints)
{
    global $options;
    $a = '<html>
 <head>
  <title>Bio2RDF Release ' . $options['r'] . '</title>
 	<link rel="stylesheet" type="text/css" href="http://134.117.53.12/lib/datatables/css/jquery.dataTables.css"/>
	<link rel="stylesheet" type="text/css" href="http://134.117.53.12/lib/datatables/css/code.css"/>

	<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
	<script type="text/javascript" src="http://134.117.53.12/lib/datatables/js/jquery.dataTables.js"></script>
	<script type="text/javascript" charset="utf-8">
		$(document).ready(function(){
			$("table").dataTable({
				"bInfo":false,
				"bPaginate":false,
				"aaSorting":[[0,"asc"]]
			});
		});
	</script>

	<style type="text/css">



	#logo{
	display:block;
	margin-left:auto;
	margin-right:auto;
	}

	#release{
	margin-left:20%;
	margin-right:20%;
	font-size: 120%;
	color:#039;
	font-weight:bold;
	}

	body {
		font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
		font-size: 10px;
		color:#174e74;
	}
	
	#links{
		background: #fff;
		margin-left:auto;
		margin-right:auto;
		text-align: center;
	}

	#tableContainer {
		margin:0 auto;
		padding-bottom: 20px;
		padding-top: 50px;
		width: 80%;
	}
</style>
</head>
<body>
<a href="http://bio2rdf.org"><img alt="Bio2RDF Homepage" id="logo" src="https://googledrive.com/host/0B3GgKfZdJasrRnB0NDNNMFZqMUk/bio2rdf_logo.png" height="80px"/></a>
<div id="links">
 <h3>Linked Data for the Life Sciences</h3>
 <h2>-Release ' . $options['r'] . '-</h2>
 <h2>[<a href="http://bio2rdf.org" target="_blank">website</a>]
    [<a href="http://download.bio2rdf.org/release/' . $options['r'] . '/release.html" target="_blank">datasets</a>]
	[<a href="http://github.com/bio2rdf/bio2rdf-scripts/wiki" target="_blank">documentation</a>]
 </h2>
</div>
<div id="tableContainer">

<table class=\\"hor-minimalist-a\\">
 <thead>
  <tr>
   <th width=\\"40\\"></th>
   <th width=\\"300\\">Dataset</th>
   <th width=\\"100\\">Date generated</th>
   <th width=\\"100\\"># of triples</th>
   <th width=\\"100\\"># of unique entities</th>
   <th width=\\"100\\"># of unique subjects</th>
  </tr>
 </thead>
';
    $i = 0;
    // initialize totals
    $options['totals']['triples'] = 0;
    $options['totals']['entities'] = 0;
    $options['totals']['subjects'] = 0;
    ksort($endpoints);
    foreach ($endpoints as $e => $endpoint_details) {
        if ($options['endpoint'] && $options['endpoint'] != $e) {
            continue;
        }
        $i++;
        $a .= printRow($endpoint_details, $i);
    }
    $a .= "\n  <tr class=\"total\">\n\t<td></td>\n\t<td></td>\t\n\t<td></td>\n\t<td>" . $options['totals']['triples'] . "</td>\n\t<td>" . $options['totals']['entities'] . "</td>\n\t<td>" . $options['totals']['subjects'] . "</td>\n  </tr>";
    $a .= "\n</table>\n<br>last updated on " . date("d-m-Y", mktime()) . "\n</body>\n</html>";
    return $a;
}
              <?php 
printRow($gas_tariff['Adjustment (~~$~~)']);
?>
            </tr>
            <tr class="table-row-odd">
              <th> Taxes ($)
              </th>
              <?php 
printRow($gas_tariff['Taxes (~~$~~)']);
?>
            </tr>
              <tr class="table-row-odd">
              <th> Total ($)
              </th>
              <?php 
printRow($gas_tariff['Total (~~$~~)']);
?>
            </tr>
           
            </table>
        </div>

        
    </div> <!-- /container -->

    <!-- Le javascript
    ================================================== -->
    <!-- load highchart libs -->
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
    <script src="js/Highcharts-3.0.4/js/highcharts.js"></script>
Esempio n. 8
0
function addColumn($table, $column_name, $column_info = '', $after = '')
{
    global $mainframe;
    $database =& JFactory::getDBO();
    $db_prefix = $mainframe->getCfg('dbprefix');
    $database->setQuery('SHOW COLUMNS FROM #__mt_' . $table . ' LIKE "' . $column_name . '"');
    $tmp = $database->loadResult();
    if ($tmp == $column_name) {
        printRow('Skipped column:' . $column_name . ' already exists.', 0);
        return false;
    } else {
        $sql = 'ALTER TABLE #__mt_' . $table . ' ADD `' . $column_name . '` ' . $column_info;
        if (!empty($after)) {
            $sql .= ' AFTER `' . $after . '`';
        }
        $database->setQuery($sql);
        if ($database->query()) {
            printRow('Added column:' . $column_name . ' to table: ' . $db_prefix . 'mt_' . $table);
            return true;
        } else {
            printRow($database->getErrorMsg() . -1);
            return false;
        }
    }
}
Esempio n. 9
0
<?php

# This form allows to enter a date. After submitting, all Bank and Cash Account-balances get
# printed seperated by Projects.
session_start();
require "accrp.php";
require "security/secure.php";
beginDocument("list Cash and Bank", $sess_user);
if ($date) {
    $ac1 = get_ac_array(1);
    foreach ($ac1 as $key => $prj_desc) {
        $accounts = new BankAndCashAccounts_byProject($key, $date, "c");
        beginPrettyTable(4, "{$prj_desc}");
        printRow(array("Account", "Balance"));
        while ($row = $accounts->getNext()) {
            printRow(array($row["AC5_DESC"], $accounts->getActualBalance() . "&nbsp;"), "irgendwas");
        }
        printRow(array("Sum", $accounts->getSum()));
        endPrettyTable();
    }
} else {
    openForm("enter Date", $PHP_SELF);
    beginPrettyTable("2", "list bank and cash");
    makeTextField("date", get_today_hrd_string(), "Date:");
    makeSubmitter();
    endPrettyTable();
    closeForm();
}
endDocument();
Esempio n. 10
0
        echo "  {$v->value};\n";
    }
    try {
        $client->get($t, $row, "entry:foo");
        throw new Exception("shouldn't get here! ");
    } catch (NotFound $nf) {
        # blank
    }
}
$columns = array();
foreach ($client->getColumnDescriptors($t) as $col => $desc) {
    echo "column with name: {$desc->name}\n";
    $columns[] = $desc->name . ":";
}
echo "Starting scanner...\n";
$scanner = $client->scannerOpenWithStop($t, "00020", "00040", $columns);
try {
    while (true) {
        printRow($client->scannerGet($scanner));
    }
} catch (NotFound $nf) {
    $client->scannerClose($scanner);
    echo "Scanner finished\n";
}
$transport->close();
?>
</pre>
</body>
</html>

Esempio n. 11
0
echo get_month_name($ref_date) . " " . get_year($ref_date) . "</div>";
if ($type == "PF") {
    $loan_table = "PF_LOAN";
} else {
    if ($type == "CUF") {
        $loan_table = "CUF_LOAN";
    } else {
        die("Loantype unspecified !");
    }
}
$result = mysql_query("select * from {$loan_table}", $db);
checkMySQLError();
beginPrettyTable("4", "{$loan_table}");
printRow(array("Emp_ID3", "Emp. Name", "LoanStart", "LoanEnd", "Loan-Amt", "Instalment", "Tot_Amt", "Due", "Balance"));
while ($row = mysql_fetch_array($result)) {
    $name = $personal_array[$row["EMP_ID3"]];
    $rest_inst_no = datediff("m", $ref_date, $row["LOAN_END"]);
    $rest_amount = $rest_inst_no * $row["INT_RATE"];
    if ($rest_inst_no < 0) {
        continue;
    }
    $inst_sum += $rest_inst_no;
    $rest_amount_sum += $rest_amount;
    $loan_amount_sum += $row["LOAN_AMT"];
    printRow(array($row["EMP_ID3"], $name, conv_to_hrd($row["LOAN_START"]), conv_to_hrd($row["LOAN_END"]), $row["LOAN_AMT"], $row["INT_RATE"], $row["TOT_AMT"], $rest_inst_no, $rest_amount), "fluct");
}
printRow(array("", "", "Loan-Amt-Sum: ", $loan_amount_sum), "", "3,2");
printRow(array("", "", "Inst-Sum: ", "", $inst_sum), "", "3,2");
printRow(array("", "", "Balance-Sum: ", "", "", "", "", $rest_amount_sum), "", "3,2");
endPrettyTable();
endDocument();
Esempio n. 12
0
    $orderby = "EMP_ID3";
}
# calculate received money by Employees
$result = mysql_query("select SUM(AMOUNT),AC_ID5 from TRANS WHERE AC_ID3=30 AND DR_CR='C' GROUP BY AC_ID5 order by PARTY", $db);
checkMySQLError();
while ($row = mysql_fetch_array($result)) {
    $receive_array[$row["AC_ID5"]] = $row["SUM(AMOUNT)"];
}
# calculate paid_back money
$result = mysql_query("select SUM(AMOUNT),PARTY, AC_ID5 from TRANS WHERE AC_ID3=30 AND DR_CR='D' GROUP BY PARTY order by PARTY", $db);
checkMySQLError();
while ($row = mysql_fetch_array($result)) {
    if (array_key_exists($row["AC_ID5"], $receive_array)) {
        $receive_array[$row["AC_ID5"]] -= $row["SUM(AMOUNT)"];
    }
}
beginPrettyTable("1", "Schedule of Advance as on " . get_today_hrd_string());
if (isset($receive_array)) {
    printRow(array("Code", "Employer's name", "Amount"));
    foreach ($receive_array as $key => $value) {
        if ($value != 0) {
            printRow(array("{$key}", get_ac5_desc_of($key), 0 - $value), "something");
        }
        $sum += 0 - $value;
    }
    printRow(array("", "Sum", $sum));
} else {
    printRow(array("No Advance-money at anybody!"), "");
}
endPrettyTable();
endDocument();
Esempio n. 13
0
            ++$j;
        }
        if (STATUS_INV != $recv_status) {
            ++$j;
        }
        ++$i;
        printf($template, $i, $a, $b, $c, $d, $e, $send_color, $send_status, $recv_color, $recv_status, $comment);
    }
    /* ---------------------------------------------------------------------- */
}
/* main --------------------------------------------------------------------- */
$i = 0;
$stats = array();
foreach ($openpgp as $a) {
    foreach ($smime as $b) {
        foreach ($message as $c) {
            foreach ($attachment as $d) {
                foreach ($receiver as $e) {
                    printRow($a, $b, $c, $d, $e, &$i, &$stats, &$result);
                }
            }
        }
    }
}
/* -------------------------------------------------------------------------- */
echo "\n";
echo " * Seems to work (<font color='" . COLOR_OK . "'>" . STATUS_OK . "</font>): " . $stats[STATUS_OK] . "\n";
echo " * To be tested (<font color='" . COLOR_TBT . "'>" . STATUS_TBT . "</font>): " . $stats[STATUS_TBT] . "\n";
echo " * Has issues (<font color='" . COLOR_ISSUE . "'>" . STATUS_ISSUE . "</font>): " . $stats[STATUS_ISSUE] . "\n";
//echo " * Not yet implemented (<font color='". COLOR_NYI ."'>" . STATUS_NYI ."</font>): ". $stats[STATUS_NYI] ."\n";
echo " * Combination not possible, out of scope or no testing needed (<font color='" . COLOR_INV . "'>" . STATUS_INV . "</font>): " . $stats[STATUS_INV] . "\n";
Esempio n. 14
0
<?php

$userInfo = array('Име' => 'Николай Иванов', 'Потребителско Име' => 'mraiur', 'Email' => '*****@*****.**', 'ID' => '123');
echo "<table border=\"1\">";
foreach ($userInfo as $key => $value) {
    printRow($key, $value);
}
echo "</table>";
function printRow($key, $value)
{
    echo "<tr>";
    echo "<td>" . $key . "</td>";
    echo "<td>" . $value . "</td>";
    echo "</tr>";
}
Esempio n. 15
0
    printRow(array("<hr>"), "", "1,6");
    printRow(array("VR No", "VR Date", "Vr Type", "Particulars", "Debit", "Credit"));
    while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
        $row["VR_DT"] = conv_to_hrd($row["VR_DT"]);
        if ($row["DR_CR"] == "D") {
            $row["DR_CR"] = $row["AMOUNT"];
            $row["AMOUNT"] = "&nbsp;";
        } else {
            $row["DR_CR"] = "&nbsp;";
        }
        printRow($row, "fluct");
    }
    printRow(array("", "", "DebitSum:", get_debit_sum("AC_ID5={$ac_name}", $enddate_srd, $startdate_srd)), "", "1,2");
    printRow(array("", "", "CreditSum:", get_credit_sum("AC_ID5={$ac_name}", $enddate_srd, $startdate_srd)), "", "1,3");
    printRow(array("<hr>"), "", "1,6");
    printRow(array("closing Balance: " . get_closing_balance("AC_ID5={$ac_name}", $enddate_srd)), "", "1,3");
    endPrettyTable();
    mysql_close($db);
} else {
    $ac_array = get_ac5_sc_array("5(1/2)");
    ?>
 
	<table cellpadding=5 cellspacing=0 border=0 width='100%'>
	 <tr>
	  <td valign=top width='15%'>
	
           <?php 
    beginPrettyTable("1");
    ?>
	   <tr>
	    <?php 
Esempio n. 16
0
                break;
            case 'QUESTION_NAME':
                if (isContainsString($row[question_name], $searchQuery)) {
                    $isPrintRow = true;
                }
                break;
            case 'RECOMMENDED':
                if ($row[recommend]) {
                    $isPrintRow = true;
                }
                break;
            default:
                break;
        }
        if ($isPrintRow) {
            printRow($row);
            $isFoundSearchResults = true;
        }
    }
    printQuestionsTableFooter();
    //</printQuestions>
    if (!$isFoundSearchResults) {
        echo MESSAGE_NO_SEARCH_RESULTS;
    }
} else {
    echo MESSAGE_NO_DATA_SUBMITTED;
}
?>
	
<p><a href="index.php"><?php 
echo MESSAGE_RETURN_TO_HOMEPAGE;
<?php

include_once '../function_header.php';
include '../common_server_functions.php';
//print_r($_REQUEST);
$responseCode = 0;
$supplier = $_REQUEST['supplier'];
if ($supplier == '0' || $supplier == '') {
    die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Please select a supplier', ''));
}
$material = $_REQUEST['material'];
if ($material == '0' || $material == '') {
    die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Please select a material', ''));
}
$price = $_REQUEST['price'];
if ($price == '0' || $price == '') {
    die(wrapFormError(ERROR_CODE_MISSING_PARAMETERS, 'Please select a price', ''));
}
$info = $_REQUEST['info'];
//die(wrapError(-2,'Feature not ready'));
saveSupplierMaterial($conexion, $supplier, $material, $price, $info);
$materialInfo = mysql_fetch_assoc(mysql_query("SELECT * FROM material WHERE materialId = '{$material}'", $conexion));
$delImg = createActionIcon(IMG_DELETE, 'delete' . $supplier . "-" . $material, 'Delete Price', '../submit/deleteSupplierMaterial.php', 'supplier=' . $supplier . '&material=' . $material, 'delete', " width='22' height='22'");
$newLine = printRow('', array($materialInfo['materialName'], decimalPad($price), date('m/d/Y'), $delImg));
$response['code'] = 0;
$response['created'] = "";
$response['newLine'] = $newLine;
echo json_encode($response);
Esempio n. 18
0
    }
    printRow(array("", "<b>total Receipts<b>", "<b>" . $transactions->getTotalReceipts() . "</b>"));
    endPrettyTable();
    # Payments
    # generate Transaction-object
    if ($ac_id1 != 0) {
        $transactions = new Transactions($ac_id1, $startdate, $enddate);
    } else {
        $transactions = new Transactions_byProject("1", $startdate, $enddate);
    }
    beginPrettyTable("4", "Payments");
    printRow(array("Code Number", "Description", "Amount", "VR-Type"));
    while ($row = $transactions->getNextPayment()) {
        printRow($row, "fluct");
    }
    printRow(array("", "<b>total Payments</b>", "<b>" . $transactions->getTotalPayments() . "</b>"));
    printRow(array("", "<b>closing Balance:</b> ", "<b>" . $transactions->getClosingBalance() . "</b>"));
    endPrettyTable();
} else {
    $ac_array = get_ac_array(1);
    $ac_array[0] = "ALL PROJECTS";
    openForm("enter Date", $PHP_SELF);
    beginPrettyTable("2", "Project Transactions");
    makeDropBox("ac_id1", $ac_array, "Project");
    makeTextField("startdate", get_today_hrd_string(), "Start Date:");
    makeTextField("enddate", get_today_hrd_string(), "End Date:");
    makeSubmitter();
    endPrettyTable();
    closeForm();
}
endDocument();
Esempio n. 19
0
			<th>Amount to Pay</th>
			<th>Date</th>
			<th></th>
		</tr>
		<?php 
$reportTotal = getInvoiceTotal($reportId, $conexion);
$paidTotal = getInvoicePaid($reportId, $conexion);
$balance = decimalPad($reportTotal - $paidTotal);
$invoiceInfo = getCustomerInvoiceInfo($conexion, $reportId);
//Truck
$flag = true;
$credits = mysql_query("SELECT * FROM customer_credit JOIN customer_super_check USING (customerSuperCheckId) WHERE\tcustomerId = '" . $invoiceInfo['customerId'] . "'", $conexion);
while ($credit = mysql_fetch_assoc($credits)) {
    $creditValue = decimalPad($credit['customerCreditAmount']);
    echo printRow(($flag ? "class='bg'" : "") . " rowId='F" . $reportId . "W" . $credit['customerSuperCheckId'] . "' ", array($credit['customerSuperCheckNumber'], $creditValue, createInputText("paymentF" . $reportId . "W" . $credit['customerSuperCheckId'], '', "size='10px'", decimalPad($creditValue > $balance ? $balance : $creditValue)), createInputText("dateF" . $reportId . "W" . $credit['customerSuperCheckId'], "", "size='10px'", to_MDY($credit['customerSuperCheckDate'])), createInputHidden("checkF" . $reportId . "W" . $credit['customerSuperCheckId'], "", "size='10px'", $credit['customerSuperCheckId']) . " " . createInputHidden("numberF" . $reportId . "W" . $credit['customerSuperCheckId'], "", "size='10px'", $credit['customerSuperCheckNumber']) . " " . printImgLink(IMG_PAY, "customerPayable", "Pay with check " . $credit['customerSuperCheckNumber'], ' width="22" height="22"')));
    $flag = !$flag;
    //createInputText($id, $name = '', $attributes = '', $startingValue ='')
}
echo printRow(($flag ? "class='bg'" : "") . " rowId='F" . $reportId . "W0' ", array("Cash", "N/A", createInputText("paymentF" . $reportId . "W0", '', "size='10px'", decimalPad($balance)), createInputText("dateF" . $reportId . "W0", "", "size='10px'", date('m/d/Y')), createInputHidden("checkF" . $reportId . "W0", '', "size='10px'", "0") . " " . createInputHidden("numberF" . $reportId . "W0", '', "size='10px'", "Cash") . " " . printImgLink(IMG_PAY, "customerPayable", "Pay with cash", ' width="22" height="22"')));
?>
	</table>
	<table>
		<tr>
			<td><?php 
echo createSimpleButton('submitButton', 'Submit');
?>
</td>
		</tr>
	</table>
</div>
Esempio n. 20
0
        while (sizeof($printrow) <= 15) {
            $printrow[] = "0";
        }
        printRow($printrow);
        reset($sal_el_array);
        unset($printrow);
        $printrow[] = $row["EMP_ID3"];
        $printrow[] = $row["EMP_NAME"];
    }
    ## perhaps should be here ?
    #if ($row["SAL_ID"]==NULL) {
    #	for ($i=0;$i<14;$i++) $printrow[]="0";
    #	continue;
    #}
    #printrow(array("name is:".$emp_name));
    #printrow(array("key vom array is ".key($sal_el_array)."und row sal_id is".$row["SAL_ID"]));
    while (!is_bool(next($sal_el_array)) && key($sal_el_array) < $row["SAL_ID"]) {
        printRow(array("inside loop :{$current}<br>"));
        $printrow[] = "0";
        #if (!next($sal_el_array))
        #	break;
        if (key($sal_el_array) == $row["SAL_ID"]) {
            break;
        }
    }
    #next($sal_el_array);
    $printrow[] = $row["SAL_AMT"];
}
endPrettyTable();
endBorderedTable();
endDocument();
Esempio n. 21
0
$result = mysql_query("SHOW TABLES FROM {$DBNAME}");
checkMySQLError();
while ($row = mysql_fetch_array($result, $db)) {
    $tablename = $row["Tables_in_{$DBNAME}"];
    $filename = "/tmp/ac4ngosdata/" . $tablename . ".txt";
    $query = "SELECT * FROM {$tablename} INTO OUTFILE \"{$filename}\"";
    $result2 = mysql_query($query, $db);
    checkMySQLError($query);
}
$today = get_today_srd_string();
$backup_filename = "ac4ngos-datadump-{$today}.tar.gz";
exec("cd /tmp; tar -czf {$backup_filename} ac4ngos/*");
$doc_root = $_SERVER["DOCUMENT_ROOT"];
copy("/tmp/{$backup_filename}", "{$doc_root}/crp/backups/{$backup_filename}");
echo "<a href=\"backups/{$backup_filename}\"> click here to download datadump</a>";
endPrettyTable();
beginPrettyTable("2", "the following datadumps are available as well:");
$handle = opendir("{$doc_root}/crp/backups/");
while (false !== ($filename = readdir($handle))) {
    if (is_file("{$doc_root}/crp/backups/{$filename}")) {
        printRow(array("<a href=\"backups/{$filename}\">{$filename}</a>"), "fluct");
    }
}
closedir($handle);
## This is easier but it works only for > PHP 4.3.0
#chdir("$doc_root/crp/backups/");
#foreach (glob("*") as $filename) {
#	printRow(array("<a href=\"backups/$filename\">$filename</a>"),"fluct");
#}
endPrettyTable();
endDocument();
Esempio n. 22
0
        $row = mysql_fetch_array($result, MYSQL_ASSOC);
        if (!$row) {
            die("No Voucher with this Number found!");
        } else {
            if ($row["VR_TP"] == "CR") {
                die("Requested Voucher is a Credit-Voucher. Credit-Vouchers can't get deleted. Instead, make a Debit-Voucher and correct the mistake!");
            } else {
                if (mysql_fetch_array($result, MYSQL_ASSOC)) {
                    die("more than one Voucher found! Database-integrity is in Danger! Call your System-maintainer!");
                }
            }
        }
        beginPrettyTable("1", "Do you want to Remove this Voucher ?");
        printRow(array("AC_Codes", "VR_TP", "Vr_No", "VR_DT", "PARTY", "NARRATION", "AMOUNT"), "", "1,5");
        $row["VR_DT"] = conv_to_hrd($row["VR_DT"]);
        printRow($row, "something");
        openForm("removevoucher_confirm_form", $PHP_SELF);
        makeHiddenField("remove_confirm", 0);
        makeHiddenField("vr_no", $vr_no);
        makeSpecialSubmitter("yes, remove it!", "this.form.remove_confirm.value=1", 6);
        endPrettyTable();
        mysql_close($db);
    } else {
        ?>
 
	<table cellpadding=5 cellspacing=0 border=0 width='100%'>
	 <tr>
	  <td valign=top width='15%'>
	
           <?php 
        beginPrettyTable("1");
function printTable($data, $fields, $row_classes, $cat, $child = 0)
{
    foreach ($data as $count => $row) {
        ?>
		<tr
			class="
  			ds-list-item-new level-<?php 
        print $child;
        ?>
 
  			<?php 
        /* print ($child == 0?'ds-list-item-new':''); */
        ?>
 ">
			<?php 
        printRow($row, $fields, $cat, $child + 1);
        if (!empty($row['child'])) {
            ?>
		</tr>
		<?php 
            printTable($row['child'], $fields, $row_classes, $cat, $child + 1);
        } else {
            ?>
		</tr>
		<?php 
        }
    }
}
Esempio n. 24
0
function printDefaultLayout()
{
    for ($class = 1; $class < 9; $class++) {
        printRow($class, "", True, True, True, True, True);
    }
}
Esempio n. 25
0
<?php

# Show Profile shows all the Customer Info, Invoices, Payments, Tickets,
# and a balance.
session_start();
require "accrp.php";
require "security/secure.php";
beginDocument($lCustomerProfile, $sess_user);
$db = getDBConnection();
#$result = mysql_query("select * from SAL_ID", $db);
#checkMySQLError();
beginPrettyTable("4", "Salary Elements");
#printRow(array("SAL_ID","Description","Income/Expense"));
$result = mysql_query("DROP TABLE test");
checkMySQLError();
$result = mysql_query("CREATE TABLE test (dummy int) TYPE=HEAP SELECT PERSONAL.EMP_ID3, EMP_NAME, SAL_ID FROM PERSONAL, SAL_ID");
checkMySQLError();
$query = "select * from test LEFT OUTER JOIN EMP_SAL USING(EMP_ID3, SAL_ID) ORDER BY test.EMP_ID3, test.SAL_ID";
$result = mysql_query($query, $db);
checkMySQLError();
while ($row = mysql_fetch_array($result)) {
    unset($printrow);
    $printrow["Name"] = $row["EMP_NAME"];
    for ($i = 0; $i < 14; $i++, $row = mysql_fetch_array($result)) {
        $printrow[] = $row["SAL_AMT"];
    }
    printRow($printrow);
}
endPrettyTable();
endDocument();
Esempio n. 26
0
        makeStaticField("desig_desc", get_designation_of($emp_id3), "Designation");
        # Income-Positions
        printRow(array("<div align=\"center\"><h2>INCOME</h2></div>"), "", "1,2");
        foreach ($income_salary_elements_array_desc as $key => $value) {
            makeTextField("salary_field_" . $key, $edit_salary["{$key}"], "{$value}", 10, "onFocus=\"editIncomeField(this.value)\" onChange=\"changedIncomeField(this.value) \"");
            $income_sum += $edit_salary["{$key}"];
        }
        makeStaticField("income_sum", $income_sum, "Income Sum:", "", 11);
        # Expense-Positions
        printRow(array("<div align=\"center\"><h2>EXPENSE</h2></div>"), "", "1,2");
        foreach ($expense_salary_elements_array_desc as $key => $value) {
            makeTextField("salary_field_" . $key, $edit_salary["{$key}"], "{$value}", 10, "onFocus=\"editExpenseField(this.value)\" onChange=\"changedExpenseField(this.value) \"");
            $expense_sum += $edit_salary["{$key}"];
        }
        makeStaticField("expense_sum", $expense_sum, "Expense Sum:", "", 11);
        printRow(array("<hr>"), "", "1,2");
        makeStaticField("total_sum", $income_sum - $expense_sum, "Total Sum:", "", 14);
        makeSpecialSubmitter("submit", "onClick='this.form.submitnow.value=\"1\"'");
        endPrettyTable();
        closeForm();
        ?>
	</td>
	  </table>
	  <?php 
    } else {
        $personal_array = get_personal_array();
        openForm("selectemployee", $PHP_SELF);
        beginPrettyTable("2", "select Employee");
        makeDropBox("emp_id3", $personal_array, "Employer Name");
        makeSubmitter();
        endPrettyTable();
Esempio n. 27
0
 function move_attachments()
 {
     $db =& JFactory::getDBO();
     $db->setQuery('SELECT * FROM #__mt_cfvalues_att WHERE raw_filename = \'\' LIMIT 0, 50');
     $atts = $db->loadObjectList();
     foreach ($atts as $att) {
         $file_extension = strrchr($att->filename, '.');
         if ($file_extension === false) {
             $file_extension = '';
         }
         $filepath = JPATH_COMPONENT_SITE . DS . 'attachments' . DS . $att->att_id . $file_extension;
         $handle = fopen($filepath, 'w');
         if (fwrite($handle, $att->filedata, $att->filesize) === FALSE) {
             printRow('Cannot write to file at ' . $filepath, 1);
         } else {
             printRow('Attachment saved to ' . $filepath);
             $db->setQuery('UPDATE #__mt_cfvalues_att SET raw_filename = \'' . $att->att_id . $file_extension . '\' WHERE att_id = ' . $att->att_id . ' LIMIT 1');
             $db->query();
         }
     }
 }
function printTable($data, $fields, $row_classes, $cat, $child = 0)
{
    foreach ($data as $count => $row) {
        ?>
  		  <tr class="<?php 
        print implode(' ', $row_classes[$count]);
        ?>
 
    			ds-list-item-new level-<?php 
        print $child;
        ?>
 " >
  			<?php 
        printRow($row, $fields, $cat, $child + 1);
        ?>
          </tr>
        <?php 
        if (!empty($row['child'])) {
            printTable($row['child'], $fields, $row_classes, $cat, $child + 1);
        }
    }
}
Esempio n. 29
0
						break;
				}
			} catch(e) {
				alert("Internal Error: Please contact the administrator.");
			}
		},
		async:	true
	});
}
</script>
<div id='formDiv' class='table'>
	<img src="/mfi/img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
	<img src="/mfi/img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
	<table class="listing form" cellpadding="0" cellspacing="0">
		<tr>
			<th colspan='4'>Supplier Information</th>
		</tr>
		<?php 
$flag = true;
//$vendorLink = printImgLink(IMG_VIEW, NYRO_CLASS, TITLE_VIEW_VENDOR, createGenericNyroableAttributesSmall($supplierInfo['vendorId'],'vendor'));
$materials = mysql_query("SELECT * FROM suppliermaterial JOIN material USING (materialId) WHERE supplierId = '{$supplierId}'", $conexion);
while ($material = mysql_fetch_assoc($materials)) {
    $delImg = createActionIcon(IMG_DELETE, 'delete' . $supplierId . "-" . $material['materialId'], 'Delete Price', '../submit/deleteSupplierMaterial.php', 'supplier=' . $supplierId . '&material=' . $material['materialId'], 'delete', " width='22' height='22'");
    echo printRow($flag ? "" : "class='bg'", array($material['materialName'], decimalPad($material['supplierMaterialPrice']), to_MDY($material['supplierMaterialLastModified']), $delImg));
    $flag = !$flag;
}
echo printRow(" id='newPriceListItem' " . ($flag ? "" : "class='bg'"), array(arrayToSelect(materialsArray($conexion), '0', 'newPriceListMaterial', 'Material'), createInputText('newPriceListPrice', '', ''), '', createSimpleButton('saveNewPriceList', 'Submit')));
?>
	</table>
</div>
Esempio n. 30
0
function wrsqz_testGetVars(){
	
	$questionId=999999999;
	$program = '<session lang=\"en\" version=\"2.0\"><library closed=\"false\"><mtext style=\"color:#ffc800\" xml:lang=\"es\">variables</mtext><group><command><input><math xmlns=\"http://www.w3.org/1998/Math/MathML\"><mi>a</mi><mo>=</mo><mn>1</mn></math></input></command><command><input><math xmlns=\"http://www.w3.org/1998/Math/MathML\"><mi>p</mi><mo>=</mo><mi>plot</mi><mo>(</mo><mi>sin</mi><mo>(</mo><mi>random</mi><mo>(</mo><mn>0</mn><mo>.</mo><mn>5</mn><mo>,</mo><mn>2</mn><mo>.</mo><mn>0</mn><mo>)</mo><mo>*</mo><mi>x</mi><mo>)</mo><mo>)</mo></math></input></command></group></library></session>';
	
	$data = new StdClass();
	$data->question = $questionId;
	$data->program = $program;
	
	$programId=insert_record('question_wshanprom',$data);
	
	$ok=true;
	
	if($programId===false){
		$ok=false;
		$message = 'Error accessing database.';
	}
	
	$wiris = new StdClass();
	$wiris->question=$questionId;
	$wiris->idcache=0;
	$wiris->md5=md5($program);
	$wiris->eqoption='';
	
	$data=array(
		'seed' => rand(),
		'text' => ' #p  ##Ta',
		'wiris' => $wiris
	);
	
	$result=wrsqz_getInfo('shortanswer',$questionId,$data);
	
	if($result['vars']['##Ta']!='1'){
		$ok = false;
		$message = 'Error with numeric variable';
	}else if(substr($result['vars']['##Wp'],0,7)!='<image>'){
		$ok=false;
		$message = 'Error with image variable';
	}
	
	if($ok){
		$message = wrsqz_assemble('Variables retrieved sucessfully. Look at the plot #p', $result['vars']);
	}
	
	delete_records('question_wshanprom', 'question', $questionId);
	printRow('Variables',$ok,$message);
	
}