$pdf->SetTextColor(0, 0, 0); $pdf->Cell(60, 5, pad($invoice, 11, '0'), 1, 0, 'C'); $pdf->Cell(1); $pdf->Cell(33, 5, $issued_on, 1, 0, 'C'); $pdf->Cell(1); $pdf->Cell(33, 5, $expire_on, 1, 0, 'C'); $pdf->Cell(1); $pdf->Cell(0, 5, number_format($credit_amount, 2, '.', ','), 1, 0, 'C'); $pdf->Ln(6); $pdf->SetTextColor(255, 255, 255); $pdf->Cell(60, 5, "User ID", 1, 0, 'C', 1); $pdf->Cell(1); $pdf->Cell(0, 5, "Employer Name", 1, 0, 'C', 1); $pdf->Ln(6); $pdf->SetTextColor(0, 0, 0); $pdf->Cell(60, 5, $employer->id(), 1, 0, 'C'); $pdf->Cell(1); $pdf->Cell(0, 5, $employer->get_name(), 1, 0, 'C'); $pdf->Ln(10); $table_header = array("No.", "Item", "Amount (" . $currency . ")"); $pdf->FancyTable($table_header); $pdf->Ln(13); $pdf->SetFont('', 'I'); $pdf->Cell(0, 0, "This credit note was automatically generated. Signature is not required.", 0, 0, 'C'); $pdf->Ln(6); $pdf->Cell(0, 5, "Refund Notice", 'LTR', 0, 'C'); $pdf->Ln(); $pdf->Cell(0, 5, "- Refund will be made payable to " . $employer->get_name() . ". ", 'LR', 0, 'C'); $pdf->Ln(); $pdf->Cell(0, 5, "- To facilitate the refund process, please inform us of any discrepancies.", 'LBR', 0, 'C'); $pdf->Ln(10);
$result = $mysqli->query($query); if (count($result) <= 0 || is_null($result)) { echo '0'; exit; } if (!$result) { echo 'ko'; exit; } foreach ($result as $i => $row) { $result[$i]['employer'] = htmlspecialchars_decode($row['employer']); } $response = array('purchases' => array('purchase' => $result)); header('Content-type: text/xml'); echo $xml_dom->get_xml_from_array($response); exit; } if ($_POST['action'] == 'confirm_payment') { $employer = new Employer($_POST['id']); $mysqli = Database::connect(); $query = "SELECT number_of_slot FROM employer_slots_purchases \n WHERE employer = '" . $employer->id() . "' AND transaction_id = '" . $_POST['txn_id'] . "' LIMIT 1"; $result = $mysqli->query($query); $employer->add_slots($result[0]['number_of_slot']); $query = "UPDATE employer_slots_purchases SET \n transaction_id = '" . $_POST['payment_id'] . "', \n purchased_on = NOW(), \n on_hold = 0 \n WHERE employer = '" . $employer->id() . "' AND transaction_id = '" . $_POST['txn_id'] . "'"; if ($mysqli->execute($query) === false) { echo 'ko'; exit; } echo 'ok'; exit; }
</p><p style="font-weight: bold;">Add an employer... </p><p><?php $employer_id = 'ken123'; $data = array(); $data['password'] = md5('new_password'); $data['license_num'] = 'my license'; $data['name'] = 'Fatt Choy Shopping Center'; $data['phone_num'] = '888 888 888 888'; $data['email_addr'] = '*****@*****.**'; $data['contact_person'] = 'Kenny Lee'; $data['zip'] = '11399'; $data['country'] = 'MY'; $data['registerby'] = 'M'; $id = 0; $employer = new Employer($employer_id); if ($employer->create($data)) { print_array(Employer::find(array('match' => 'id = \'' . $employer->id() . '\''))); } else { echo "failed"; exit; } ?> </p><p style="font-weight: bold;">Add a stack of employer fees for ken123... </p><p><?php $fees = array(); $data = array(); $data['employer'] = $employer_id; $data['service_fee'] = 1.5; $data['premier_fee'] = 0.0; $data['discount'] = 0.05; $data['salary_start'] = 1.0; $data['salary_end'] = 30000.0; $fees[0] = $data;