void insert(const uint64& g)
{
// avoid loops for performance
if (guid[0] == 0) { guid[0] = g; return; }
else if (g <= guid[0]) { if (guid[3]) guid[4] = guid[3]; if (guid[2]) guid[3] = guid[2]; if (guid[1]) guid[2] = guid[1]; guid[1] = guid[0]; guid[0] = g; return; }
if (guid[1] == 0) { guid[1] = g; return; }
else if (g <= guid[1]) { if (guid[3]) guid[4] = guid[3]; if (guid[2]) guid[3] = guid[2]; guid[2] = guid[1]; guid[1] = g; return; }
if (guid[2] == 0) { guid[2] = g; return; }
else if (g <= guid[2]) { if (guid[3]) guid[4] = guid[3]; guid[3] = guid[2]; guid[2] = g; return; }
if (guid[3] == 0) { guid[3] = g; return; }
else if (g <= guid[3]) { guid[4] = guid[3]; guid[3] = g; return; }
guid[4] = g;
}
void force_insert_front(const uint64& g)
{
if (guid[3]) guid[4] = guid[3]; if (guid[2]) guid[3] = guid[2]; if (guid[1]) guid[2] = guid[1]; guid[1] = guid[0]; guid[0] = g;
}
void remove(const uint64& g)
{
// avoid loops for performance
if (guid[0] == g) { if (guid[1]) guid[0] = guid[1]; else { guid[0] = 0; return; } if (guid[2]) guid[1] = guid[2]; else { guid[1] = 0; return; } if (guid[3]) guid[2] = guid[3]; else { guid[2] = 0; return; } if (guid[4]) guid[3] = guid[4]; else { guid[3] = 0; return; } guid[4] = 0; return; }
if (guid[1] == g) { if (guid[2]) guid[1] = guid[2]; else { guid[1] = 0; return; } if (guid[3]) guid[2] = guid[3]; else { guid[2] = 0; return; } if (guid[4]) guid[3] = guid[4]; else { guid[3] = 0; return; } guid[4] = 0; return; }
if (guid[2] == g) { if (guid[3]) guid[2] = guid[3]; else { guid[2] = 0; return; } if (guid[4]) guid[3] = guid[4]; else { guid[3] = 0; return; } guid[4] = 0; return; }
if (guid[3] == g) { if (guid[4]) guid[3] = guid[4]; else { guid[3] = 0; return; } guid[4] = 0; return; }
if (guid[4] == g) guid[4] = 0;
}
bool hasGuid(const uint64& g) const
{
return g && (guid[0] == g || guid[1] == g || guid[2] == g || guid[3] == g || guid[4] == g);
}
bool operator<(const Lfg5Guids& x) const
{
// not neat, but fast xD
if (guid[0]<=x.guid[0]) {
if (guid[0] == x.guid[0]) {
if (guid[1]<=x.guid[1]) {
if (guid[1] == x.guid[1]) {
if (guid[2]<=x.guid[2]) {
if (guid[2] == x.guid[2]) {
if (guid[3]<=x.guid[3]) {
if (guid[3] == x.guid[3]) {
if (guid[4]<=x.guid[4]) {
if (guid[4] == x.guid[4]) return false; else return true;
} else return false;
} else return true;
} else return false;
} else return true;
} else return false;
} else return true;
} else return false;
} else return true;
} else return false;
}
bool operator==(const Lfg5Guids& x) const
{
return guid[0] == x.guid[0] && guid[1] == x.guid[1] && guid[2] == x.guid[2] && guid[3] == x.guid[3] && guid[4] == x.guid[4];
}
Console.WriteLine("|"+ Espace(x-1) + (h==3?" o":""));
Console.WriteLine("|"+ Espace(x-1) + (h==2?" o":(h==3?"/|\\":"")));
Console.WriteLine("|"+ Espace(x-1) + (h==1?" o":(h==2?"/|\\":(h==3?" |":""))));
Console.WriteLine("|"+ Espace(x-1) + (h==0?" o":(h==1?"/|\\":(h==2?" |":(h==3?"/ \\":"")))));
Console.WriteLine("|"+ Espace(x-1) + (h==0?"/|\\":(h==1?" |":(h==2?"/ \\":""))));
Console.WriteLine("|"+ Espace(x-1) + (h==0?" |":(h==1?"/ \\":"")));
Console.WriteLine("|"+ Espace(x-1) + (h==0?"/ \\" : ""));
if (!empty($tickets)) {
if (count($tickets)) {
$c_start = strtotime($convetion_details['start']);
$c_end = strtotime($convetion_details['end']);
$i = 0;
while ($c_start <= $c_end) {
if (is_int($i / 4) && $i > 0) $convetion_days_html .= '</tr><tr>';
$convetion_days_html .= '<td>' . date('d.m', $c_start) . ' ' . __t($days_of_week[date('w', $c_start)]) . ' <img src="' . str_replace('https', 'http', TEMPLATE_WWWPATH) . '/images/checkbox.png"/></td>';
$c_start = strtotime('+1 day', $c_start);
$i++;
}
//...
legacy code from 2007 indians
switch (numberOfQuestionsToAnswer) {
case 0:
displayGrid1 = false;
displayGrid2 = false;
displayGrid3 = false;
displayGrid4 = false;
displayGrid5 = false;
displayGrid6 = false;
displayGrid7 = false;
displayGrid8 = false;
displayGrid9 = false;
displayGrid10 = false;
break;
case 1:
displayAnsInputTextBox1 = displayPreselectedAnsBox();
displayGrid1 = true;
break;
case 2:
displayAnsInputTextBox1 = displayPreselectedAnsBox();
displayAnsInputTextBox2 = displayPreselectedAnsBox();
displayGrid1 = true;
displayGrid2 = true;
break;
case 3:
displayAnsInputTextBox1 = displayPreselectedAnsBox();
displayAnsInputTextBox2 = displayPreselectedAnsBox();
displayAnsInputTextBox3 = displayPreselectedAnsBox();
displayGrid1 = true;
displayGrid2 = true;
displayGrid3 = true;
break;
case 4:
displayAnsInputTextBox1 = displayPreselectedAnsBox();
displayAnsInputTextBox2 = displayPreselectedAnsBox();
displayAnsInputTextBox3 = displayPreselectedAnsBox();
displayAnsInputTextBox4 = displayPreselectedAnsBox();
displayGrid1 = true;
displayGrid2 = true;
displayGrid3 = true;
displayGrid4 = true;
break;
case 5:
displayAnsInputTextBox1 = displayPreselectedAnsBox();
displayAnsInputTextBox2 = displayPreselectedAnsBox();
displayAnsInputTextBox3 = displayPreselectedAnsBox();
displayAnsInputTextBox4 = displayPreselectedAnsBox();
displayAnsInputTextBox5 = displayPreselectedAnsBox();
displayGrid1 = true;
displayGrid2 = true;
displayGrid3 = true;
displayGrid4 = true;
displayGrid5 = true;
break;
case 6:
displayAnsInputTextBox1 = displayPreselectedAnsBox();
displayAnsInputTextBox2 = displayPreselectedAnsBox();
displayAnsInputTextBox3 = displayPreselectedAnsBox();
displayAnsInputTextBox4 = displayPreselectedAnsBox();
displayAnsInputTextBox5 = displayPreselectedAnsBox();
displayAnsInputTextBox6 = displayPreselectedAnsBox();
displayGrid1 = true;
displayGrid2 = true;
displayGrid3 = true;
displayGrid4 = true;
displayGrid5 = true;
displayGrid6 = true;
break;
case 7:
displayAnsInputTextBox1 = displayPreselectedAnsBox();
displayAnsInputTextBox2 = displayPreselectedAnsBox();
displayAnsInputTextBox3 = displayPreselectedAnsBox();
displayAnsInputTextBox4 = displayPreselectedAnsBox();
displayAnsInputTextBox5 = displayPreselectedAnsBox();
displayAnsInputTextBox6 = displayPreselectedAnsBox();
displayAnsInputTextBox7 = displayPreselectedAnsBox();
displayGrid1 = true;
displayGrid2 = true;
displayGrid3 = true;
displayGrid4 = true;
displayGrid5 = true;
displayGrid6 = true;
displayGrid7 = true;
break;
case 8:
displayAnsInputTextBox1 = displayPreselectedAnsBox();
displayAnsInputTextBox2 = displayPreselectedAnsBox();
displayAnsInputTextBox3 = displayPreselectedAnsBox();
displayAnsInputTextBox4 = displayPreselectedAnsBox();
displayAnsInputTextBox5 = displayPreselectedAnsBox();
displayAnsInputTextBox6 = displayPreselectedAnsBox();
displayAnsInputTextBox7 = displayPreselectedAnsBox();
displayAnsInputTextBox8 = displayPreselectedAnsBox();
displayGrid1 = true;
displayGrid2 = true;
displayGrid3 = true;
displayGrid4 = true;
displayGrid5 = true;
displayGrid6 = true;
displayGrid7 = true;
displayGrid8 = true;
break;
case 9:
displayAnsInputTextBox1 = displayPreselectedAnsBox();
displayAnsInputTextBox2 = displayPreselectedAnsBox();
displayAnsInputTextBox3 = displayPreselectedAnsBox();
displayAnsInputTextBox4 = displayPreselectedAnsBox();
displayAnsInputTextBox5 = displayPreselectedAnsBox();
displayAnsInputTextBox6 = displayPreselectedAnsBox();
displayAnsInputTextBox7 = displayPreselectedAnsBox();
displayAnsInputTextBox8 = displayPreselectedAnsBox();
displayAnsInputTextBox9 = displayPreselectedAnsBox();
displayGrid1 = true;
displayGrid2 = true;
displayGrid3 = true;
displayGrid4 = true;
displayGrid5 = true;
displayGrid6 = true;
displayGrid7 = true;
displayGrid8 = true;
displayGrid9 = true;
break;
case 10:
displayAnsInputTextBox1 = displayPreselectedAnsBox();
displayAnsInputTextBox2 = displayPreselectedAnsBox();
displayAnsInputTextBox3 = displayPreselectedAnsBox();
displayAnsInputTextBox4 = displayPreselectedAnsBox();
displayAnsInputTextBox5 = displayPreselectedAnsBox();
displayAnsInputTextBox6 = displayPreselectedAnsBox();
displayAnsInputTextBox7 = displayPreselectedAnsBox();
displayAnsInputTextBox8 = displayPreselectedAnsBox();
displayAnsInputTextBox9 = displayPreselectedAnsBox();
displayAnsInputTextBox10 = displayPreselectedAnsBox();
displayGrid1 = true;
displayGrid2 = true;
displayGrid3 = true;
displayGrid4 = true;
displayGrid5 = true;
displayGrid6 = true;
displayGrid7 = true;
displayGrid8 = true;
displayGrid9 = true;
displayGrid10 = true;
break;
}
This was for a wizard type questionnaire where there could be up to 10 questions.
public function getProduct($product_id) {
$query = $this->db->query("SELECT DISTINCT *, pd.name AS name, p.image, m.name AS manufacturer, (SELECT price FROM " . DB_PREFIX . "product_discount pd2 WHERE pd2.product_id = p.product_id AND pd2.customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "' AND pd2.quantity = '1' AND ((pd2.date_start = '0000-00-00' OR pd2.date_start < NOW()) AND (pd2.date_end = '0000-00-00' OR pd2.date_end > NOW())) ORDER BY pd2.priority ASC, pd2.price ASC LIMIT 1) AS discount, (SELECT price FROM " . DB_PREFIX . "product_special ps WHERE ps.product_id = p.product_id AND ps.customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "' AND ((ps.date_start = '0000-00-00' OR ps.date_start < NOW()) AND (ps.date_end = '0000-00-00' OR ps.date_end > NOW())) ORDER BY ps.priority ASC, ps.price ASC LIMIT 1) AS special, (SELECT points FROM " . DB_PREFIX . "product_reward pr WHERE pr.product_id = p.product_id AND pr.customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "') AS reward, (SELECT ss.name FROM " . DB_PREFIX . "stock_status ss WHERE ss.stock_status_id = p.stock_status_id AND ss.language_id = '" . (int)$this->config->get('config_language_id') . "') AS stock_status, (SELECT wcd.unit FROM " . DB_PREFIX . "weight_class_description wcd WHERE p.weight_class_id = wcd.weight_class_id AND wcd.language_id = '" . (int)$this->config->get('config_language_id') . "') AS weight_class, (SELECT lcd.unit FROM " . DB_PREFIX . "length_class_description lcd WHERE p.length_class_id = lcd.length_class_id AND lcd.language_id = '" . (int)$this->config->get('config_language_id') . "') AS length_class, (SELECT AVG(rating) AS total FROM " . DB_PREFIX . "review r1 WHERE r1.product_id = p.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating, (SELECT COUNT(*) AS total FROM " . DB_PREFIX . "review r2 WHERE r2.product_id = p.product_id AND r2.status = '1' GROUP BY r2.product_id) AS reviews, p.sort_order FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN " . DB_PREFIX . "manufacturer m ON (p.manufacturer_id = m.manufacturer_id) WHERE p.product_id = '" . (int)$product_id . "' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "'");
/* ... */
Opencart's Product model
@RequestMapping(value = "user/getOnlineApplicationsList", produces = "XML/Text; charset=utf-8", method = RequestMethod.POST)
public @ResponseBody String getOnlineApplicationsList(HttpSession session, HttpServletRequest request,
@RequestParam("status") int status, @RequestParam("fullname") String fullname,
@RequestParam("privateNumber") String privateNumber, @RequestParam("phoneNumber") String phoneNumber,
@RequestParam("applicationIdFrom") String applicationIdFrom,
@RequestParam("applicationIdTo") String applicationIdTo,
// @RequestParam("dateFrom") String timeFrom,
// @RequestParam("dateTo") String timeTo,
@RequestParam("order") int order, @RequestParam("companyId") int companyId) {
try {
TimeFunctions tf = new TimeFunctions();
StringBuilder ret = new StringBuilder();
List<OnlineApplication> onlineAppList = new ArrayList<OnlineApplication>();
List<OnlineApplicationForConsumerLoan> onlineAppListCL = new ArrayList<OnlineApplicationForConsumerLoan>();
if (companyId == 3) {
onlineAppList = onlineAppService.getOnlineApps(fullname, privateNumber,
tf.dateStrToMilliseconds("11-11-1111"), tf.dateStrToMilliseconds("11-11-9999"), 0, 250, order,
status, phoneNumber, applicationIdFrom, applicationIdTo);
}
else if (companyId == 2) {
onlineAppListCL = onlineAppService.getConsumerOnlineApps(fullname, privateNumber,
tf.dateStrToMilliseconds("11-11-1111"), tf.dateStrToMilliseconds("11-11-9999"), 0, 250, order,
status, phoneNumber, applicationIdFrom, applicationIdTo);
}
else {
onlineAppList = onlineAppService.getOnlineApps(fullname, privateNumber,
tf.dateStrToMilliseconds("11-11-1111"), tf.dateStrToMilliseconds("11-11-9999"), 0, 250, order,
status, phoneNumber, applicationIdFrom, applicationIdTo);
onlineAppListCL = onlineAppService.getConsumerOnlineApps(fullname, privateNumber,
tf.dateStrToMilliseconds("11-11-1111"), tf.dateStrToMilliseconds("11-11-9999"), 0, 250, order,
status, phoneNumber, applicationIdFrom, applicationIdTo);
}
for (OnlineApplication onlineApp : onlineAppList) {
if (onlineApp.getStatus() == 0) {
ret.append("<br>"
+ "<table style=\"width:100%; height: 180px; border: 1px solid black; text-align:center; border-collapse: collapse; spacing: 5px;\">"
+ "<tr style=\"background-color:#85C1E9; height: 20px; font-weight: bold;\">"
+ "<td>ID</td>" + "<td>თანხა</td>" + "<td>პერიოდი</td>" + "<td>სახელი გვარი</td>"
+ "<td>დაბ.თარიღი</td>" + "<td>პირადი ნომ.</td>" + "<td>მობილური</td>"
+ "<td>სამუშაო სფერო</td>" + "<td>კომპანია</td>" + "<td>პოზიცია</td>" + "<td>ხელფასი</td>"
+ "<td>სტატუსი</td>" + "</tr>" + "<tr>" + "<td>" + onlineApp.getOnlineAppId() + "</td>"
+ "<td>" + Math.round(onlineApp.getAmount().doubleValue() * 100.0) / 100.0 + "</td>"
+ "<td>" + onlineApp.getPeriod() + "</td>" + "<td>" + onlineApp.getFullname() + "</td>"
+ "<td>" + onlineApp.getBirthdate() + "</td>" + "<td>" + onlineApp.getPersonalNumber()
+ "</td>" + "<td>" + onlineApp.getMobilephone() + "</td>" + "<td>"
+ onlineApp.getWorkField() + "</td>" + "<td>" + onlineApp.getCompanyName() + "</td>"
+ "<td>" + onlineApp.getPosition() + "</td>" + "<td>" + onlineApp.getSalary() + "</td>"
+ "<td>" + getNameForStatus(onlineApp.getStatus()) + "</td>" + "</tr>"
+ "<tr style=\"background-color:#85C1E9; height: 20px; font-weight: bold;\">"
+ "<td>მუშ.ხან.</td>" + "<td>დამ.შემოსავალი</td>" + "<td>თვ.გადასახდელი</td>"
+ "<td>ოჯახ.მდგომ.</td>" + "<td>შვილები</td>" + "<td>დასაქ.ოჯახ.წევრები</td>"
+ "<td>საერთო შემოსავალი</td>" + "<td>თარიღი</td>" + "<td>ინკასო</td>" +
"<td>დადასტურება</td>"+ "<td>უარყოფა</td>" + "<td>წაშლა</td>" + "</tr>" + "<tr>" + "<td>"
+ onlineApp.getWorkTime() + "</td>" + "<td>" + onlineApp.getAdditionalIncome() + "</td>"
+ "<td>" + onlineApp.getLoanFreqAmount() + "</td>" + "<td>" + onlineApp.getMaritalStatus()
+ "</td>" + "<td>" + onlineApp.getChildren() + "</td>" + "<td>"
+ onlineApp.getWorkingRelatives() + "</td>" + "<td>" + onlineApp.getTotalIncome() + "</td>"
+ "<td>" + tf.millisecondsToDateStr(onlineApp.getAdditionTime()) + "</td>"
+ "<td>"+(onlineApp.isIncaso() ? "ინკასო":"არ ადევს")+"</td>" + "<td bgcolor=\"lightgreen\" onclick=\"approveApplication(" + onlineApp.getOnlineAppId()
+ "," + onlineApp.getCompany() + ")\"><img height=\"20px\" width=\"20px\" src=\""
+ request.getContextPath() + "/resources/images/accept.png\"></td>"
+ "<td bgcolor=\"LightCoral\" onclick=\"rejectApplication(" + onlineApp.getOnlineAppId()
+ "," + onlineApp.getCompany() + ")\"><img height=\"20px\" width=\"20px\" src=\""
+ request.getContextPath() + "/resources/images/reject.png\"></td>"
+ "<td bgcolor=\"silver\" onclick=\"deleteApplication(" + onlineApp.getOnlineAppId() + ","
+ onlineApp.getCompany() + ")\"><img height=\"20px\" width=\"20px\" src=\""
+ request.getContextPath() + "/resources/images/delete.png\"></td>" + "</tr>" + ""
+ "<tr><td colspan=\"3\">" + onlineApp.getLoanPurpose() + "</td><td colspan=\"5\">" + onlineApp.getBranch() + "</td></tr></table>" + "<br>");
} else if (onlineApp.getStatus() == 1) {
ret.append("<br>"
+ "<table style=\"width:100%; height: 180px; border: 1px solid black; text-align:center; border-collapse: collapse; spacing: 5px;\">"
+ "<tr style=\"background-color:#85C1E9; height: 20px; font-weight: bold;\">"
+ "<td>ID</td>" + "<td>თანხა</td>" + "<td>პერიოდი</td>" + "<td>სახელი გვარი</td>"
+ "<td>დაბ.თარიღი</td>" + "<td>პირადი ნომ.</td>" + "<td>მობილური</td>"
+ "<td>სამუშაო სფერო</td>" + "<td>კომპანია</td>" + "<td>პოზიცია</td>" + "<td>ხელფასი</td>"
+ "<td>სტატუსი</td>" + "</tr>" + "<tr>" + "<td>" + onlineApp.getOnlineAppId() + "</td>"
+ "<td>" + Math.round(onlineApp.getAmount().doubleValue() * 100.0) / 100.0 + "</td>"
+ "<td>" + onlineApp.getPeriod() + "</td>" + "<td>" + onlineApp.getFullname() + "</td>"
+ "<td>" + onlineApp.getBirthdate() + "</td>" + "<td>" + onlineApp.getPersonalNumber()
+ "</td>" + "<td>" + onlineApp.getMobilephone() + "</td>" + "<td>"
+ onlineApp.getWorkField() + "</td>" + "<td>" + onlineApp.getCompanyName() + "</td>"
+ "<td>" + onlineApp.getPosition() + "</td>" + "<td>" + onlineApp.getSalary() + "</td>"
+ "<td>" + getNameForStatus(onlineApp.getStatus()) + "</td>" + "</tr>"
+ "<tr style=\"background-color:#85C1E9; height: 20px; font-weight: bold;\">"
+ "<td>მუშ.ხან.</td>" + "<td>დამ.შემოსავალი</td>" + "<td>თვ.გადასახდელი</td>"
+ "<td>ოჯახ.მდგომ.</td>" + "<td>შვილები</td>" + "<td>დასაქ.ოჯახ.წევრები</td>"
+ "<td>საერთო შემოსავალი</td>" + "<td>თარიღი</td>" + "<td>ინკასო</td>"
+ "<td align=\"center\">კომენტარები</td><td align=\"center\">აპლიკაციის დამატება</td><td align=\"center\">აპლიკაციის უარყოფა</td>"
+ "</tr>" + "<tr>" + "<td>" + onlineApp.getWorkTime() + "</td>" + "<td>"
+ onlineApp.getAdditionalIncome() + "</td>" + "<td>" + onlineApp.getLoanFreqAmount()
+ "</td>" + "<td>" + onlineApp.getMaritalStatus() + "</td>" + "<td>"
+ onlineApp.getChildren() + "</td>" + "<td>" + onlineApp.getWorkingRelatives() + "</td>"
+ "<td>" + onlineApp.getTotalIncome() + "</td>" + "<td>"
+ tf.millisecondsToDateStr(onlineApp.getAdditionTime()) +
"<td>"+(onlineApp.isIncaso() ? "ინკასო":"არ ადევს")+"</td>"
+ "</td><td onclick=\"triggerComments(" + onlineApp.getOnlineAppId() + ","
+ onlineApp.getCompany() + ")\"><img height=\"20px\" width=\"20px\" src=\""
+ request.getContextPath() + "/resources/images/comment.png\"></td>"
+ "<td bgcolor=\"lightgreen\" onclick=\"acceptApplication(" + onlineApp.getOnlineAppId()
+ "," + onlineApp.getCompany() + ")\"><img height=\"20px\" width=\"20px\" src=\""
+ request.getContextPath() + "/resources/images/accept.png\"></td>"
+ "<td bgcolor=\"LightCoral\" onclick=\"rejectApplication(" + onlineApp.getOnlineAppId()
+ "," + onlineApp.getCompany() + ")\"><img height=\"20px\" width=\"20px\" src=\""
+ request.getContextPath() + "/resources/images/reject.png\"></td>" + "</tr>"
+ "<tr><td colspan=\"3\">" + onlineApp.getLoanPurpose() + "</td><td colspan=\"5\">" + onlineApp.getBranch() + "</td></tr></table>" + "</table>"
+ "<br>");
} else {
ret.append("<br>"
+ "<table style=\"width:100%; height: 180px; border: 1px solid black; text-align:center; border-collapse: collapse; spacing: 5px;\">"
+ "<tr style=\"background-color:#85C1E9; height: 20px; font-weight: bold;\">"
+ "<td>ID</td>" + "<td>თანხა</td>" + "<td>პერიოდი</td>" + "<td>სახელი გვარი</td>"
+ "<td>დაბ.თარიღი</td>" + "<td>პირადი ნომ.</td>" + "<td>მობილური</td>"
+ "<td>სამუშაო სფერო</td>" + "<td>კომპანია</td>" + "<td>პოზიცია</td>" + "<td>ხელფასი</td>"
+ "<td>სტატუსი</td>" + "</tr>" + "<tr>" + "<td>" + onlineApp.getOnlineAppId() + "</td>"
+ "<td>" + Math.round(onlineApp.getAmount().doubleValue() * 100.0) / 100.0 + "</td>"
+ "<td>" + onlineApp.getPeriod() + "</td>" + "<td>" + onlineApp.getFullname() + "</td>"
+ "<td>" + onlineApp.getBirthdate() + "</td>" + "<td>" + onlineApp.getPersonalNumber()
+ "</td>" + "<td>" + onlineApp.getMobilephone() + "</td>" + "<td>"
+ onlineApp.getWorkField() + "</td>" + "<td>" + onlineApp.getCompanyName() + "</td>"
+ "<td>" + onlineApp.getPosition() + "</td>" + "<td>" + onlineApp.getSalary() + "</td>"
+ "<td>" + getNameForStatus(onlineApp.getStatus()) + "</td>" + "</tr>"
+ "<tr style=\"background-color:#85C1E9; height: 20px; font-weight: bold;\">"
+ "<td>მუშ.ხან.</td>" + "<td>დამ.შემოსავალი</td>" + "<td>თვ.გადასახდელი</td>"
+ "<td>ოჯახ.მდგომ.</td>" + "<td>შვილები</td>" + "<td>დასაქ.ოჯახ.წევრები</td>"
+ "<td>საერთო შემოსავალი</td>" + "<td>თარიღი</td>" + "<td>ინკასო</td>"
+ "<td colspan=\"3\" align=\"center\">კომენტარები</td>" + "</tr>" + "<tr>" + "<td>"
+ onlineApp.getWorkTime() + "</td>" + "<td>" + onlineApp.getAdditionalIncome() + "</td>"
+ "<td>" + onlineApp.getLoanFreqAmount() + "</td>" + "<td>" + onlineApp.getMaritalStatus()
+ "</td>" + "<td>" + onlineApp.getChildren() + "</td>" + "<td>"
+ onlineApp.getWorkingRelatives() + "</td>" + "<td>" + onlineApp.getTotalIncome() + "</td>"
+ "<td>" + tf.millisecondsToDateStr(onlineApp.getAdditionTime()) + "</td>" +
"<td>"+(onlineApp.isIncaso() ? "ინკასო":"არ ადევს")+"</td>"
+ "<td colspan=\"3\" onclick=\"triggerComments(" + onlineApp.getOnlineAppId() + ","
+ onlineApp.getCompany() + ")\"><img height=\"20px\" width=\"20px\" src=\""
+ request.getContextPath() + "/resources/images/comment.png\"></td>"
+ ((onlineApp.getStatus() != 2) ? "<td colspan=\"3\" onclick=\"changeStatus("
+ onlineApp.getOnlineAppId() + "," + onlineApp.getCompany() + "," + 0
+ ")\"><img height=\"20px\" width=\"20px\" src=\"" + request.getContextPath()
+ "/resources/images/resume.png\" title=\"აპლიკაციაში დაბრუნება\"></td>" : "")
+ "</tr>" + "<tr><td colspan=\"3\">" + onlineApp.getLoanPurpose() + "</td><td colspan=\"5\">" + onlineApp.getBranch() + "</td></tr></table>"
+ "</table>" + "<br>");
}
}
for (OnlineApplicationForConsumerLoan onlineApp : onlineAppListCL) {
// TODO: change below
int consCompId = 2;
if (onlineApp.getStatus() == 0) {
ret.append("<br>"
+ "<table style=\"width:100%; height: 180px; border: 1px solid black; text-align:center; border-collapse: collapse; spacing: 5px;\">"
+ "<tr style=\"background-color:Coral; height: 20px; font-weight: bold;\">" + "<td>ID</td>"
+ "<td>თანხა</td>" + "<td>პერიოდი</td>" + "<td>სახელი გვარი</td>" + "<td>დაბ.თარიღი</td>"
+ "<td>პირადი ნომ.</td>" + "<td>მობილური</td>" + "<td>სამუშაო სფერო</td>"
+ "<td>კომპანია</td>" + "<td>პოზიცია</td>" + "<td>ხელფასი</td>" + "<td>სტატუსი</td>"
+ "</tr>" + "<tr>" + "<td>" + onlineApp.getId() + "</td>" + "<td>"
+ Math.round(onlineApp.getLoanAmount() * 100.0) / 100.0 + "</td>" + "<td>"
+ onlineApp.getLoanPeriod() + "</td>" + "<td>" + onlineApp.getName() + "</td>" + "<td>"
+ onlineApp.getBirthDate() + "</td>" + "<td>" + onlineApp.getPrivateNumber() + "</td>"
+ "<td>" + onlineApp.getMobileNumber() + "</td>" + "<td>" + onlineApp.getWorkSphere()
+ "</td>" + "<td>" + onlineApp.getCompanyName() + "</td>" + "<td>"
+ onlineApp.getWorkPosition() + "</td>" + "<td>" + onlineApp.getSalary() + "</td>" + "<td>"
+ getNameForStatus(onlineApp.getStatus()) + "</td>" + "</tr>"
+ "<tr style=\"background-color:Coral; height: 20px; font-weight: bold;\">"
+ "<td>მუშ.ხან.</td>" + "<td>დამ.შემოსავალი</td>" + "<td>თვ.გადასახდელი</td>"
+ "<td>ოჯახ.მდგომ.</td>" + "<td>შვილები</td>" + "<td>დასაქ.ოჯახ.წევრები</td>"
+ "<td>საერთო შემოსავალი</td>" + "<td>თარიღი</td>" + "<td>ინკასო</td>" + "<td>დადასტურება</td>"
+ "<td>უარყოფა</td>" + "<td>წაშლა</td>" + "</tr>" + "<tr>" + "<td>"
+ onlineApp.getWorkPeriod() + "</td>" + "<td>" + onlineApp.getOtherIncome() + "</td>"
+ "<td>" + onlineApp.getAmountToPayOnOtherLoans() + "</td>" + "<td>"
+ onlineApp.getMaritalStatus() + "</td>" + "<td>" + onlineApp.getNumberOfChildren()
+ "</td>" + "<td>" + onlineApp.getEmployedFamilyMembers() + "</td>" + "<td>"
+ onlineApp.getTotalFamilyIncome() + "</td>" + "<td>"
+ tf.millisecondsToDateStr(onlineApp.getAdditionTime()) + "</td>" +
"<td>"+(onlineApp.isIncaso() ? "ინკასო":"არ ადევს")+"</td>"
+ "<td bgcolor=\"lightgreen\" onclick=\"approveApplication(" + onlineApp.getId() + ","
+ consCompId + ")\"><img height=\"20px\" width=\"20px\" src=\"" + request.getContextPath()
+ "/resources/images/accept.png\"></td>"
+ "<td bgcolor=\"LightCoral\" onclick=\"rejectApplication(" + onlineApp.getId() + ","
+ consCompId + ")\"><img height=\"20px\" width=\"20px\" src=\"" + request.getContextPath()
+ "/resources/images/reject.png\"></td>"
+ "<td bgcolor=\"silver\" onclick=\"deleteApplication(" + onlineApp.getId() + ","
+ consCompId + ")\"><img height=\"20px\" width=\"20px\" src=\"" + request.getContextPath()
+ "/resources/images/delete.png\"></td>" + "</tr>"
+ "<tr><td colspan=\"3\">"+onlineApp.getLoanPurpose()+"</td><td colspan=\"5\" align=\"left\"> " + onlineApp.getBranchOfficeName() + "</td></tr>"
+ "</table>" + "<br>");
} else if (onlineApp.getStatus() == 1) {
ret.append("<br>"
+ "<table style=\"width:100%; height: 180px; border: 1px solid black; text-align:center; border-collapse: collapse; spacing: 5px;\">"
+ "<tr style=\"background-color:Coral; height: 20px; font-weight: bold;\">" + "<td>ID</td>"
+ "<td>თანხა</td>" + "<td>პერიოდი</td>" + "<td>სახელი გვარი</td>" + "<td>დაბ.თარიღი</td>"
+ "<td>პირადი ნომ.</td>" + "<td>მობილური</td>" + "<td>სამუშაო სფერო</td>"
+ "<td>კომპანია</td>" + "<td>პოზიცია</td>" + "<td>ხელფასი</td>" + "<td>სტატუსი</td>"
+ "</tr>" + "<tr>" + "<td>" + onlineApp.getId() + "</td>" + "<td>"
+ Math.round(onlineApp.getLoanAmount() * 100.0) / 100.0 + "</td>" + "<td>"
+ onlineApp.getLoanPeriod() + "</td>" + "<td>" + onlineApp.getName() + "</td>" + "<td>"
+ onlineApp.getBirthDate() + "</td>" + "<td>" + onlineApp.getPrivateNumber() + "</td>"
+ "<td>" + onlineApp.getMobileNumber() + "</td>" + "<td>" + onlineApp.getWorkSphere()
+ "</td>" + "<td>" + onlineApp.getCompanyName() + "</td>" + "<td>"
+ onlineApp.getWorkPosition() + "</td>" + "<td>" + onlineApp.getSalary() + "</td>" + "<td>"
+ getNameForStatus(onlineApp.getStatus()) + "</td>" + "</tr>"
+ "<tr style=\"background-color:Coral; height: 20px; font-weight: bold;\">"
+ "<td>მუშ.ხან.</td>" + "<td>დამ.შემოსავალი</td>" + "<td>თვ.გადასახდელი</td>"
+ "<td>ოჯახ.მდგომ.</td>" + "<td>შვილები</td>" + "<td>დასაქ.ოჯახ.წევრები</td>"
+ "<td>საერთო შემოსავალი</td>" + "<td>თარიღი</td>" + "<td>ინკასო</td>"
+ "<td align=\"center\">კომენტარები</td><td align=\"center\">აპლიკაციის დამატება</td><td align=\"center\">აპლიკაციის უარყოფა</td>"
+ "</tr>" + "<tr>" + "<td>" + onlineApp.getWorkPeriod() + "</td>" + "<td>"
+ onlineApp.getOtherIncome() + "</td>" + "<td>" + onlineApp.getAmountToPayOnOtherLoans()
+ "</td>" + "<td>" + onlineApp.getMaritalStatus() + "</td>" + "<td>"
+ onlineApp.getNumberOfChildren() + "</td>" + "<td>" + onlineApp.getEmployedFamilyMembers()
+ "</td>" + "<td>" + onlineApp.getTotalFamilyIncome() + "</td>" +
"<td>"+(onlineApp.isIncaso() ? "ინკასო":"არ ადევს")+"</td>" +
"<td>" + tf.millisecondsToDateStr(onlineApp.getAdditionTime()) + "</td>"
+ "<td onclick=\"triggerComments(" + onlineApp.getId() + "," + consCompId
+ ")\"><img height=\"20px\" width=\"20px\" src=\"" + request.getContextPath()
+ "/resources/images/comment.png\"></td>"
+ "<td bgcolor=\"lightgreen\" onclick=\"acceptApplication(" + onlineApp.getId() + ","
+ consCompId + ")\"><img height=\"20px\" width=\"20px\" src=\"" + request.getContextPath()
+ "/resources/images/accept.png\"></td>"
+ "<td bgcolor=\"LightCoral\" onclick=\"rejectApplication(" + onlineApp.getId() + ","
+ consCompId + ")\"><img height=\"20px\" width=\"20px\" src=\"" + request.getContextPath()
+ "/resources/images/reject.png\"></td>" + "</tr>"
+ "<tr><td colspan=\"3\">" + onlineApp.getLoanPurpose() + "</td><td colspan=\"5\" align=\"left\"> " + onlineApp.getBranchOfficeName() + "</td></tr>"
+ "</table>" + "<br>");
} else {
ret.append("<br>"
+ "<table style=\"width:100%; height: 180px; border: 1px solid black; text-align:center; border-collapse: collapse; spacing: 5px;\">"
+ "<tr style=\"background-color:Coral; height: 20px; font-weight: bold;\">" + "<td>ID</td>"
+ "<td>თანხა</td>" + "<td>პერიოდი</td>" + "<td>სახელი გვარი</td>" + "<td>დაბ.თარიღი</td>"
+ "<td>პირადი ნომ.</td>" + "<td>მობილური</td>" + "<td>სამუშაო სფერო</td>"
+ "<td>კომპანია</td>" + "<td>პოზიცია</td>" + "<td>ხელფასი</td>" + "<td>სტატუსი</td>"
+ "</tr>" + "<tr>" + "<td>" + onlineApp.getId() + "</td>" + "<td>"
+ Math.round(onlineApp.getLoanAmount() * 100.0) / 100.0 + "</td>" + "<td>"
+ onlineApp.getLoanPeriod() + "</td>" + "<td>" + onlineApp.getName() + "</td>" + "<td>"
+ onlineApp.getBirthDate() + "</td>" + "<td>" + onlineApp.getPrivateNumber() + "</td>"
+ "<td>" + onlineApp.getMobileNumber() + "</td>" + "<td>" + onlineApp.getWorkSphere()
+ "</td>" + "<td>" + onlineApp.getCompanyName() + "</td>" + "<td>"
+ onlineApp.getWorkPosition() + "</td>" + "<td>" + onlineApp.getSalary() + "</td>" + "<td>"
+ getNameForStatus(onlineApp.getStatus()) + "</td>" + "</tr>"
+ "<tr style=\"background-color:Coral; height: 20px; font-weight: bold;\">"
+ "<td>მუშ.ხან.</td>" + "<td>დამ.შემოსავალი</td>" + "<td>თვ.გადასახდელი</td>"
+ "<td>ოჯახ.მდგომ.</td>" + "<td>შვილები</td>" + "<td>დასაქ.ოჯახ.წევრები</td>"
+ "<td>საერთო შემოსავალი</td>" + "<td>თარიღი</td>" + "<td>ინკასო</td>"
+ "<td colspan=\"3\" align=\"center\">კომენტარები</td>" + "</tr>" + "<tr>" + "<td>"
+ onlineApp.getWorkPeriod() + "</td>" + "<td>" + onlineApp.getOtherIncome() + "</td>"
+ "<td>" + onlineApp.getAmountToPayOnOtherLoans() + "</td>" + "<td>"
+ onlineApp.getMaritalStatus() + "</td>" + "<td>" + onlineApp.getNumberOfChildren()
+ "</td>" + "<td>" + onlineApp.getEmployedFamilyMembers() + "</td>" + "<td>"
+ onlineApp.getTotalFamilyIncome() + "</td>" + "<td>"
+ "<td>"+(onlineApp.isIncaso() ? "ინკასო":"არ ადევს")+"</td>"
+ tf.millisecondsToDateStr(onlineApp.getAdditionTime()) + "</td>"
+ "<td colspan=\"3\" onclick=\"triggerComments(" + onlineApp.getId() + "," + consCompId
+ ")\"><img height=\"20px\" width=\"20px\" src=\"" + request.getContextPath()
+ "/resources/images/comment.png\"></td>"
+ ((onlineApp.getStatus() != 2)
? "<td colspan=\"4\" onclick=\"changeStatus(" + onlineApp.getId() + "," + consCompId
+ "," + 0 + ")\"><img height=\"20px\" width=\"20px\" src=\""
+ request.getContextPath()
+ "/resources/images/resume.png\" title=\"აპლიკაციაში დაბრუნება\"></td>"
: "")
+ "</tr>" + "<tr><td colspan=\"3\" align=\"left\"> " + onlineApp.getBranchOfficeName()
+ "</td></tr>" + "</table>" + "<br>");
}
}
return ret.toString();
} catch (Exception e) {
e.printStackTrace();
return "სესხის სტატუსის შეცვლისას დაფიქსირდა შეცდომა: " + e.toString();
}
}
// Is this valid?
function validateStockInItems() {
if (stockInItemsToUpdate.length === 0)
return true;
return true;
}
Found in a legacy code base for a stock management system. I will be rewriting said system soon.
final boolean True = true;
final boolean False = false;
//why
:v
for x,x1 in enumerate(hack):
if hack[x] in letters:
exception +=1
ffs why
bool b = connection.isConnected() == true ? true : false;
My first internship presented me with this.
if( %rightBtnCmd $= "noButtons" )
{
//do nothing, as there are no buttons
}
proprietary script language.
void function(object* thing)
{
bool enabled = thing && thing->enabled() ? true : false;
...
}
o.isInsured = function ()
{ return !!this.insured; }
Why don't be like normal people and use bool() cast?
int i=0;
for (i=0; i<msg.length;i++){
switch (i){
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 18:
case 19:
case 26:
case 27:
case 34:
case 35:
case 42:
case 43:
case 50:
case 51:
case 52:
case 53:
case 54:
case 55:
case 58:
case 59:
case 62:
case 63: log.debug("******** TRAZA-BEA: autenticacion ntlm. mensaje[" + i + "]: " + msg[i] + " SINSIGNO: " + (int)(msg[i] & 0x00ff) + " " + new String(msg,i,1, "UTF-16LE")); break;
case 12:
case 14:
case 16:
case 20:
case 22:
case 24:
case 28:
case 30:
case 32:
case 36:
case 38:
case 40:
case 44:
case 46:
case 48:
case 56:
case 60:log.debug("******** TRAZA-BEA: autenticacion ntlm. mensaje[" + i + "]: " + msg[i] + " SINSIGNO: " + (int)(msg[i] & 0x00ff) + " " + new String(msg,i,2, "UTF-16LE")); break;
case 13:
case 15:
case 17:
case 21:
case 23:
case 25:
case 29:
case 31:
case 33:
case 37:
case 39:
case 41:
case 45:
case 47:
case 49:
case 57:
Why not case 60? LOL
<?php
$now = time();
while ($now + 10 > time()) {
// Just chill...smoke a blunt
}
echo "Done.\n";