2022-04-20 10:04:53 +00:00
|
|
|
$(document).ready(() => {
|
2023-06-09 16:17:06 +00:00
|
|
|
$("#type").on("change", deviceInputs2);
|
|
|
|
$("#amount").on("change", deviceInputs2);
|
|
|
|
deviceInputs2()
|
|
|
|
})
|
|
|
|
|
|
|
|
function deviceInputs2() {
|
2022-01-24 12:48:16 +00:00
|
|
|
deviceInputs();
|
2022-06-29 11:40:00 +00:00
|
|
|
amountInputs();
|
2023-06-09 16:17:06 +00:00
|
|
|
}
|
2022-01-19 12:40:40 +00:00
|
|
|
|
|
|
|
function deviceInputs() {
|
2022-05-16 10:40:14 +00:00
|
|
|
if ($("#type").val() == "ComputerMonitor") {
|
2022-01-19 12:40:40 +00:00
|
|
|
$("#screen").show();
|
|
|
|
$("#resolution").show();
|
2023-06-09 16:17:06 +00:00
|
|
|
$("#components2").hide();
|
2022-01-19 12:40:40 +00:00
|
|
|
$("#imei").hide();
|
|
|
|
$("#meid").hide();
|
2023-06-09 16:17:06 +00:00
|
|
|
$("#data_storage_size").hide();
|
2022-04-20 10:04:53 +00:00
|
|
|
} else if (["Smartphone", "Cellphone", "Tablet"].includes($("#type").val())) {
|
2022-01-19 12:40:40 +00:00
|
|
|
$("#screen").hide();
|
|
|
|
$("#resolution").hide();
|
2023-06-09 16:17:06 +00:00
|
|
|
$("#components2").hide();
|
2022-01-19 12:40:40 +00:00
|
|
|
$("#imei").show();
|
|
|
|
$("#meid").show();
|
2023-06-09 16:17:06 +00:00
|
|
|
$("#data_storage_size").show();
|
|
|
|
} else if (["HardDrive", "SolidStateDrive"].includes($("#type").val())) {
|
|
|
|
$("#screen").hide();
|
|
|
|
$("#resolution").hide();
|
|
|
|
$("#components2").hide();
|
|
|
|
$("#imei").hide();
|
|
|
|
$("#meid").hide();
|
|
|
|
$("#data_storage_size").show();
|
2022-01-19 12:40:40 +00:00
|
|
|
} else {
|
|
|
|
$("#screen").hide();
|
|
|
|
$("#resolution").hide();
|
|
|
|
$("#imei").hide();
|
|
|
|
$("#meid").hide();
|
2023-06-09 16:17:06 +00:00
|
|
|
$("#data_storage_size").hide();
|
|
|
|
$("#components2").show();
|
2022-06-29 11:40:00 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
function amountInputs() {
|
|
|
|
if ($("#amount").val() > 1) {
|
|
|
|
$("#Phid").hide();
|
2022-06-29 15:31:54 +00:00
|
|
|
$("#Id_device_supplier").hide();
|
2022-10-05 07:18:42 +00:00
|
|
|
$("#Id_device_internal").hide();
|
2022-06-29 15:31:54 +00:00
|
|
|
$("#Serial_number").hide();
|
2022-10-05 07:18:42 +00:00
|
|
|
$("#Part_number").hide();
|
2022-06-29 15:31:54 +00:00
|
|
|
$("#Sku").hide();
|
|
|
|
$("#imei").hide();
|
|
|
|
$("#meid").hide();
|
2023-06-09 16:17:06 +00:00
|
|
|
$("#data_storage_size").hide();
|
2022-06-29 11:40:00 +00:00
|
|
|
} else {
|
|
|
|
$("#Phid").show();
|
2022-06-29 15:31:54 +00:00
|
|
|
$("#Id_device_supplier").show();
|
2022-10-05 07:18:42 +00:00
|
|
|
$("#Id_device_internal").show();
|
2022-06-29 15:31:54 +00:00
|
|
|
$("#Serial_number").show();
|
2022-10-05 07:18:42 +00:00
|
|
|
$("#Part_number").show();
|
2022-06-29 15:31:54 +00:00
|
|
|
$("#Sku").show();
|
2022-06-29 11:40:00 +00:00
|
|
|
};
|
2022-01-19 12:40:40 +00:00
|
|
|
}
|