function getReceitasTotal() { //Inicia uma Sessão $this->init_session(); //Recupera o id do usuário logado $idFormaPagamento = $this->escape("idFormaPagamento"); $mes = $this->escape("mes"); $ano = $this->escape("ano"); $dias_do_mes = cal_days_in_month(CAL_GREGORIAN, $mes, $ano); $lancamentos = Doctrine_Query::create()->select("l.idLancamentoFinanceiro, " . "l.valorBaixado")->from("Lancamentofinanceiro l")->where("l.status like 'Baixado' and l.origemNotaFiscal = 0 and l.pagarReceber = 1 and l.dataBaixa >= '" . $ano . "-" . $mes . "-01' and l.dataBaixa <= '" . $ano . "-" . $mes . "-" . $dias_do_mes . "' and l.idFormaPagamento = {$idFormaPagamento}")->execute()->toArray(); $valorTotal = 0; for ($i = 0; $i < count($lancamentos); $i++) { $valorTotal += $lancamentos[$i]["valorBaixado"]; } setlocale(LC_MONETARY, 'it_IT'); //$valorTotal = money_format('%.2n', $valorTotal); $valorTotal = pv($valorTotal); echo $valorTotal; }
$course_pack = pv('course_pack', 0); $durable_url = pv('durable_url', 0); $alumni_access = pv('alumni_access', 0); $ill_print = pv('ill_print', 0); $ill_electronic = pv('ill_electronic', 0); $ill_ariel = pv('ill_ariel', 0); $walk_in = pv('walk_in', 0); $research_private_study = pv('research_private_study', 0); $blackboard = pv('blackboard', 0); $perpetual_access = pv('perpetual_access', 0); $perpetual_access_note = pv('perpetual_access_note', ''); $sherpa_romeo = pv('sherpa_romeo', ''); $password = pv('password', ''); $notes = pv('notes', ''); $notes_public = pv('notes_public', ''); $doc_alias = pv('doc_alias', ''); $errormsg = array(); if (!$title) { $errormsg[] = "A title is required."; } if (!$tag) { $errormsg[] = 'Please supply a tag for this record.'; } else { if (!preg_match('/^[a-z][a-z0-9_]+$/i', $tag)) { $errormsg[] = 'Tags may only contain letters, numbers, and the underscore ("_") character'; } else { if (file_exists('../' . $tag)) { $errormsg[] = 'The tag "' . $tag . '" is not available.'; } else { if (($tid = $db->tagExists($tag)) && $tid != $id) { $errormsg[] = 'The tag "' . $tag . '" is not available.';
/** * Returns the Net Present Value of a series of cashflows. * * @param array $cashflows Indexed array of cash flows. * @param number $rate Discount rate applied. * @return string NPV of $cashflows discounted at $rate. */ function npv(array $cashflows, $rate) { $npv = "0.0"; foreach ($cashflows as $index => $cashflow) { $npv += pv($cashflow, $rate, $index); } return (string) $npv; }
pv(); ?> </div> </div> <div id="footer" style="float:left; width : 100%; background :grey;"> User:<b><?php pv(); ?> </b> © 2012 Simuino Team<br/><?php pv(); ?> <br/><?php pv(); ?> <br/><?php pv(); ?> </div> <div id="error" style="float:left; width : 100%; background :white;"> <?php pv(); ?> <br/><?php pv(); ?> </div> </body> </html>
if (!function_exists('pv')) { function pv($key, $default = false) { if (isset($_POST[$key])) { return $_POST[$key]; } return $default; } } if (!$data) { $id = pv('id', -1); $date_signed_approved = date('Y-m-d'); if (pv('date_signed_approved')) { $date_signed_approved = implode('-', pv('date_signed_approved')); } $data = array('title' => pv('title', ''), 'tag' => pv('tag', ''), 'vendor' => pv('vendor', 0), 'consortium' => pv('consortium', 0), 'e_reserves' => pv('e_reserves', 0), 'course_pack' => pv('course_pack', 0), 'durable_url' => pv('durable_url', 0), 'alumni_access' => pv('alumni_access', 0), 'ill_print' => pv('ill_print', 0), 'ill_electronic' => pv('ill_electronic', 0), 'ill_ariel' => pv('ill_ariel', 0), 'walk_in' => pv('walk_in', 0), 'handouts' => pv('handouts', 0), 'images' => pv('images', 0), 'research_private_study' => pv('research_private_study', 1), 'blackboard' => pv('blackboard', 1), 'fulltext' => pv('walk_in', 1), 'password' => pv('password', ''), 'perpetual_access' => pv('perpetual_access', 0), 'perpetual_access_note' => pv('perpetual_access_note', ''), 'notes' => pv('notes', ''), 'sherpa_romeo' => pv('sherpa_romeo', ''), 'notes_public' => pv('notes_public', ''), 'date_signed_approved' => $date_signed_approved, 'doc_alias' => ''); } if (isset($msg) && $msg) { echo '<div class="message">' . $msg . '</div>'; } foreach ($data as $i => $v) { $data[$i] = stripslashes($v); } //var_export($data); extract($data); $title = htmlspecialchars($title); $tag = htmlspecialchars($tag); $notes = htmlspecialchars($notes); $sherpa_romeo = htmlspecialchars($sherpa_romeo); $notes_public = htmlspecialchars($notes_public); function select($which, $selected, &$db)