echo "<input type=\"radio\" value=\"75\" name=\"ts_fee_prospect\" {$probable} /> Probable "; echo "<input type=\"radio\" value=\"100\" name=\"ts_fee_prospect\" {$definite} /> Definite</p>"; // Text field echo "<h3>Description</h3><p>"; echo "<span class=\"minitext\">(if applicable)</span>"; echo "<br /><input type=\"text\" name=\"ts_fee_text\" value=\"{$ts_fee_text}\" maxlength=\"60\" size=\"60\" /></p>"; echo "<h3>Comment</h3><p>"; echo "<textarea name=\"ts_fee_comment\" style=\"width: 90%; height: 50px;\">" . $ts_fee_comment . "</textarea></p>"; echo "</fieldset>"; echo "<fieldset><legend>Fee Type</legend>"; echo "<h3>Fixed Fee for Stage</h3><p><input type=\"radio\" value=\"value\" name=\"choose\""; if ($ts_fee_value > 0) { echo " checked=\"checked\" "; } echo " /> (£) <input type=\"text\" name=\"ts_fee_value\" size=\"24\" value=\""; echo NumberFormat($ts_fee_value); echo "\" /></p>"; echo "<h3>Profit Target</h3>"; echo "<select name=\"ts_fee_target\">"; if ($ts_fee_target == 1.0) { $fee_target = " selected=\"selected\""; } else { unset($fee_target); } echo "<option value=\"1.0\" {$fee_target}>Cost / Nil Profit</option>"; if ($ts_fee_target == 1.05) { $fee_target = " selected=\"selected\""; } else { unset($fee_target); } echo "<option value=\"1.05\" {$fee_target}>5% Profit</option>";
function reportTransport() { $this->getMenu(); $this->data['form']['date_from'] = $this->input->post('date_from'); $this->data['form']['date_to'] = $this->input->post('date_to'); $this->data['form']['paid'] = $this->input->post('paid'); $this->session->set_userdata('date_from', $this->data['form']['date_from']); $this->session->set_userdata('date_to', $this->data['form']['date_to']); $this->data['form']['paid'] = $this->input->post('paid'); $this->session->set_userdata('paid', $this->data['form']['paid']); $this->data['back'] = $this->data['site'] . '/report'; $this->data['row'] = ""; if (strlen($this->data['form']['date_from'] > 0)) { $rows = $this->reportModel->getReportTransport($this->data['form']); if (count($rows) > 0) { $i = 1; $total_office = 0; $total_office_cost = 0; $total_intown = 0; $total_intown_cost = 0; $total_outtown = 0; $total_outtown_cost = 0; $total_uknown = 0; $total_uknown_cost = 0; $total_n = 0; $total_cost = 0; $cost = 0; $cost1 = 0; $actual = 0; foreach ($rows as $k => $v) { $class = $i % 2 == 0 ? $class = 'class="odd"' : ' '; $total_office += $v['office']; $total_office_cost += $v['office_cost']; $total_intown += $v['intown']; $total_intown_cost += $v['intown_cost']; $total_outtown += $v['outtown']; $total_outtown_cost += $v['outtown_cost']; $total_uknown += $v['uknown']; $total_uknown_cost += $v['uknown_cost']; $total_n += $v['total']; $total_cost += $v['cost']; $cost = $v['cost']; $office = $v['office'] > 0 ? NumberFormat($v['office']) : ""; $off_cost = $v['office_cost'] > 0 ? number_format($v['office_cost'], 2) : ""; $intown = $v['intown'] > 0 ? NumberFormat($v['intown']) : ""; $intown_cost = $v['intown_cost'] > 0 ? number_format($v['intown_cost'], 2) : ""; $outtown = $v['outtown'] > 0 ? NumberFormat($v['outtown']) : ""; $outtown_cost = $v['outtown_cost'] > 0 ? number_format($v['outtown_cost'], 2) : ""; $uknown = $v['uknown'] > 0 ? NumberFormat($v['uknown']) : ""; $uknown_cost = $v['uknown_cost'] > 0 ? number_format($v['uknown_cost'], 2) : ""; // $total = $v['total'] > 0 ? NumberFormat($v['total']) : ""; $total = $office + $intown + $outtown + $uknown; $this->data['row'] .= " \t\t\n\t\t \t\t<tr {$class} >\n\t\t \t\t\t\t<td>{$i}</td>\n\t\t \t\t\t\t<td>{$v['employeeid']}</td>\n\t\t \t\t\t\t<td>{$v['employeefirstname']} {$v['employeemiddlename']} {$v['employeelastname']}</td>\n\t\t \t\t\t\t<td class='currency'>{$office}</td>\n\t\t\t\t\t\t\t<td class='currency'>{$off_cost}</td>\n\t\t \t\t\t\t<td class='currency'>{$intown}</td>\n\t\t\t\t\t\t\t<td class='currency'>{$intown_cost}</td>\n\t\t \t\t\t\t<td class='currency'>{$outtown}</td>\n\t\t\t\t\t\t\t<td class='currency'>{$outtown_cost}</td>\n\t\t\t\t\t\t\t<td class='currency'>{$uknown}</td>\n\t\t\t\t\t\t\t<td class='currency'>{$uknown_cost}</td>\n\t\t\t\t\t\t\t<td class='currency'>{$total}</td>\n\t\t\t\t\t\t\t<td class='currency'>" . number_format($cost, "2") . "</td>\n\t\t \t\t</tr>"; $i++; } $this->data['row'] .= " \t\t\n \t\t<tr>\n \t\t\t\t<td colspan=3 class='currency'><b>Total</b>\n \t\t\t\t<td class='currency'><b>" . NumberFormat($total_office) . "</b></td>\n\t\t\t\t\t<td class='currency'><b>" . number_format($total_office_cost, 2) . "</b></td>\n \t\t\t\t<td class='currency'><b>" . NumberFormat($total_intown) . "</b></td>\n\t\t\t\t\t<td class='currency'><b>" . number_format($total_intown_cost, 2) . "</b></td>\n \t\t\t\t<td class='currency'><b>" . NumberFormat($total_outtown) . "</b></td>\n\t\t\t\t\t<td class='currency'><b>" . number_format($total_outtown_cost, 2) . "</b></td>\n\t\t\t\t\t<td class='currency'><b>" . NumberFormat($total_uknown) . "</b></td>\n\t\t\t\t\t<td class='currency'><b>" . number_format($total_uknown_cost, 2) . "</b></td>\n\t\t\t\t\t<td class='currency'><b>" . NumberFormat($total_n) . "</b></td>\n\t\t\t\t\t<td class='currency'><b>" . number_format($total_cost, 2) . "</b></td>\n \t\t</tr>"; } } else { $this->data['table'] = array(); } $this->load->view('report_transport', $this->data); }
$ts_expense_vat = $array['ts_expense_vat']; $ts_expense_id = $array['ts_expense_id']; $ts_expense_invoiced = $array['ts_expense_invoiced']; $ts_expense_receipt = $array['ts_expense_receipt']; $expense_date_day = date("d", $ts_expense_date); $expense_date_month = date("m", $ts_expense_date); $expense_date_year = date("Y", $ts_expense_date); if ($user_usertpe_current > 3) { $ts_expense_verified = $_POST[ts_expense_verified]; $ts_expense_invoiced = $_POST[ts_expense_invoiced]; } print "<h2>Edit Mileage Claim</h2>"; print "<form action=\"index2.php?page=timesheet_expense_view&ts_expense_id={$ts_expense_id}\" method=\"post\">"; } else { $ts_expense_project = CleanNumber($_POST[ts_expense_project]); $ts_expense_value = NumberFormat($_POST[ts_expense_value]); $ts_expense_date = CleanNumber($_POST[ts_expense_date]); $ts_expense_desc = CleanUp($_POST[ts_expense_desc]); $ts_expense_user = CleanNumber($_POST[ts_expense_user]); $ts_expense_verified = $_POST[ts_expense_verified]; $ts_expense_vat = $_POST[ts_expense_vat]; $ts_expense_invoiced = $_POST[ts_expense_invoiced]; $ts_expense_receipt = $_POST[ts_expense_receipt]; $expense_date_day = CleanNumber($_POST[ts_expense_day]); $expense_date_month = CleanNumber($_POST[ts_expense_month]); $expense_date_year = CleanNumber($_POST[ts_expense_year]); if ($_GET[proj_id] != NULL) { $proj_id_page = $_GET[proj_id]; } print "<h2>Add Mileage Claim</h2>"; print "<form action=\"index2.php?page=timesheet_expense_view\" method=\"post\">";
print "<option value=\"{$proj_id}\" class=\"inputbox\""; if ($ts_expense_project == $proj_id) { print " selected"; } elseif ($proj_id == $proj_id_page) { print " selected"; } print ">{$proj_num} {$proj_name}</option>"; } print "</select></p>"; // Text field print "<p>Description<br /><textarea name=\"ts_expense_desc\" rows=\"6\" cols=\"38\">{$ts_expense_desc}</textarea></p>"; print "<p>Value<br />£<input type=\"text\" name=\"ts_expense_value\" size=\"24\" value=\""; if ($ts_expense_vat > $ts_expense_value) { print NumberFormat($ts_expense_vat); } else { print NumberFormat($ts_expense_value); } print "\" /></p>"; if ($ts_expense_value > 0) { $vat_check = $ts_expense_vat / $ts_expense_value; } else { $vat_check = 0; } $vat_old = $vat_check * 1000; $vat_old = round($vat_old / 5) * 5; $vat_old = $vat_old / 10 - 100; if ($ts_expense_vat > 0) { $vat_now = $vat_old; } else { $vat_now = $settings_vat; }