Haroldo,
Sim. segue onRecord:
if ({IMOVEL_NEGOCIO} == '1' || {IMOVEL_NEGOCIO} == '3') {
if ({IMOVEL_STATUS_NEGOCIACAO} == '1'){
{IMOVEL_STATUS_NEGOCIACAO} = "<img src=\"../_lib/img/checked-box-vazio-24.png\" width=\"16\" height=\"16\" border=\"0\">";
} elseif ({IMOVEL_STATUS_NEGOCIACAO} == '4') {
{IMOVEL_STATUS_NEGOCIACAO} = "<img src=\"../_lib/img/checked-box-mark-24.png\" width=\"16\" height=\"16\" border=\"0\">";
}
} elseif ({IMOVEL_NEGOCIO} == '2') {
if ({IMOVEL_STATUS_NEGOCIACAO} == '1'){
{IMOVEL_STATUS_NEGOCIACAO} = "<img src=\"../_lib/img/checked-box-vazio-24.png\" width=\"16\" height=\"16\" border=\"0\">";
} elseif ({IMOVEL_STATUS_NEGOCIACAO} == '3') {
{IMOVEL_STATUS_NEGOCIACAO} = "<img src=\"../_lib/img/checked-box-mark-24.png\" width=\"16\" height=\"16\" border=\"0\">";
}
}
e no evento ajax onClick:
sc_select(rs, "SELECT IMOVEL_NEGOCIO, IMOVEL_STATUS_NEGOCIACAO FROM tbl_imoveis WHERE IMOVEL_ID = '".{IMOVEL_ID}."' ");
if ($rs->fields[0] == '1' || $rs->fields[0] == '3') {
if ($rs->fields[1] == '1'){
sc_exec_sql("UPDATE tbl_imoveis SET IMOVEL_STATUS_NEGOCIACAO = 4 WHERE IMOVEL_ID = {IMOVEL_ID}");
} elseif ($rs->fields[1] == '4') {
sc_exec_sql("UPDATE tbl_imoveis SET IMOVEL_STATUS_NEGOCIACAO = 1 WHERE IMOVEL_ID = {IMOVEL_ID}");
}
} elseif ($rs->fields[0] == '2') {
if ($rs->fields[1] == '1'){
sc_exec_sql("UPDATE tbl_imoveis SET IMOVEL_STATUS_NEGOCIACAO = 3 WHERE IMOVEL_ID = {IMOVEL_ID}");
} elseif ($rs->fields[1] == '3') {
sc_exec_sql("UPDATE tbl_imoveis SET IMOVEL_STATUS_NEGOCIACAO = 1 WHERE IMOVEL_ID = {IMOVEL_ID}");
}
}
sc_ajax_refresh();
Esses scripts seguem a video aula da Camila Moreira: https://www.youtube.com/watch?v=j4mqC5rPBQA