/*

*/

//
//  Schoonmaker menu-acties
//

function asle_DND()
{
    $.post("werkdetail.asp?DND=1&mode=save&id=" + key,
                   $("form[name=u2]").serialize(), //data,
                   McltCallbackAndThen(function (json)
                        {
                            $(location).attr('href',"../../../appl/pda/reports.asp?usrrap_key=41");
                        }),
                   "json");
}

// start de schoonmaak werkzaamheden.
function asle_Start()
{
    $.post("werkdetail.asp?Start=1&mode=save&id=" + key,
                   $("form[name=u2]").serialize(), //data,
                   McltCallbackAndThen(function (json)
                        {             
                            $(location).attr('href',"./werkdetail.asp?id="+key);
                        }),
                   "json");
}

// herstart de werkzaamheden op deze kamer
function asle_ReStart()
{
    $.post("werkdetail.asp?ReStart=1&mode=save&id=" + key,
                   $("form[name=u2]").serialize(), //data,
                   McltCallbackAndThen(function (json)
                        {             
                            $(location).attr('href',"./werkdetail.asp?id="+key);
                        }),
                   "json");
}

//            
// maak een melding aan op deze kamer
function asle_Call(loc_key, bld_key, floor_key, room_key)
{
 //   alert("Maak melding aan met ruimte_key:" + room);
    $.post("werkdetail.asp?mode=save&id=" + key,
                   $("form[name=u2]").serialize(), //data,
                   McltCallbackAndThen(function (json)
                        {             
                            $(location).attr('href',"../../../appl/pda/melding.asp?locatie_key="+loc_key+"&gebouw_key="+bld_key+"&verdieping_key="+floor_key+"&ruimte_key="+room_key+"&stdm_key=81");
                        }),
                   "json");
}

// klaar met de schoonmaak van deze kamer
function asle_Ready()
{
    $.post("werkdetail.asp?ready=1&mode=save&id=" + key,
                   $("form[name=u2]").serialize(), //data,
                   McltCallbackAndThen(function (json)
                        {
                            $(location).attr('href',"../../../appl/pda/reports.asp?usrrap_key=41");
                        }),
                   "json");
}

// stop de huidige schoonmaak
function asle_Stop()
{
    $.post("werkdetail.asp?stop=1&mode=save&id=" + key,
                   $("form[name=u2]").serialize(), //data,
                   McltCallbackAndThen(function (json)
                        {
                            $(location).attr('href',"../../../appl/pda/reports.asp?usrrap_key=41");
                        }),
                   "json");
}

// roep de lijst weer op 
function asle_Back()
{
    $.post("werkdetail.asp?mode=save&id=" + key,
                   $("form[name=u2]").serialize(), //data,
                   McltCallbackAndThen(function (json)
                        {
                            $(location).attr('href',"../../../appl/pda/reports.asp?usrrap_key=41");
                        }),
                   "json");
}

// Supervisor menu-acties

function asle_mBack()
{
    $.post("sup_detail_chk.asp?mode=save&id=" + key,
                   $("form[name=u2]").serialize(), //data,
                   McltCallbackAndThen(function (json)
                        {
                            $(location).attr('href',"../../../appl/pda/reports.asp?usrrap_key=261");
                        }),
                   "json");
}

function asle_mReady(maction)
{
    if (maction == "NoService" || maction == "Check")
    { 
      $.post("sup_detail_chk.asp?mClose=1&mode=save&id=" + key,
                   $("form[name=u2]").serialize(), //data,
                   McltCallbackAndThen(function (json)
                        {
                            $(location).attr('href',"../../../appl/pda/reports.asp?usrrap_key=261");
                        }),
                   "json");
    }
    else 
    {
       $.post("sup_detail_chk.asp?mode=save&id=" + key,
                   $("form[name=u2]").serialize(), //data,
                   McltCallbackAndThen(function (json)
                        {
                            $(location).attr('href',"../../../appl/pda/order_new.asp?mld_key="+key+"&opdr_type=5");
                        }),
                   "json");     
    }
}

function asle_sCall(loc_key, bld_key, floor_key, room_key)
{
 //   alert("Maak melding aan met ruimte_key:" + room);
    $.post("sup_detail.asp?mode=save&id=" + key,
                   $("form[name=u2]").serialize(), //data,
                   McltCallbackAndThen(function (json)
                        {             
                            $(location).attr('href',"../../../appl/pda/melding.asp?locatie_key="+loc_key+"&gebouw_key="+bld_key+"&verdieping_key="+floor_key+"&ruimte_key="+room_key+"&stdm_key=81");
                        }),
                   "json");
}

function asle_sBack()
{
    $.post("sup_detail.asp?mode=save&id=" + key,
                   $("form[name=u2]").serialize(), //data,
                   McltCallbackAndThen(function (json)
                        {
                            $(location).attr('href',"../../../appl/pda/reports.asp?usrrap_key=121");
                        }),
                   "json");
}

function asle_sOK()
{
    $.post("sup_detail.asp?mode=save&OK=1&id=" + key,
                   $("form[name=u2]").serialize(), //data,
                   McltCallbackAndThen(function (json)
                        {
                            $(location).attr('href',"../../../appl/pda/reports.asp?usrrap_key=121");
                        }),
                   "json");
}

function asle_sNOK(mld_key, uitv_key)
{
    $.post("sup_detail.asp?mode=save&NOK=1&id=" + key,
                   $("form[name=u2]").serialize(), //data,
                   McltCallbackAndThen(function (json)
                        {
                            $(location).attr('href',"../../../appl/pda/order.asp?mld_key="+mld_key+"&opdr_type=101&uitv_key="+uitv_key);
                        }),
                   "json");
}

function asle_sPlan()
{
    $.post("sup_detail.asp?mode=save&plan=1&id=" + key,
                   $("form[name=u2]").serialize(), //data,
                   McltCallbackAndThen(function (json)
                        {
                            $(location).attr('href',"../../../appl/pda/reports.asp?usrrap_key=121");
                        }),
                   "json");
}

// Supervisor meldt: klaar met de schoonmaak van deze kamer
function asle_sReady()
{
    $.post("sup_detail.asp?ready=1&mode=save&id=" + key,
                   $("form[name=u2]").serialize(), //data,
                   McltCallbackAndThen(function (json)
                        {
                            $(location).attr('href',"../../../appl/pda/reports.asp?usrrap_key=121");
                        }),
                   "json");
}
