jQuery(function() {
    jQuery('a.trigger_name').click(function() {
        var id = jQuery(this).parent('td').parent('tr').attr('id');
        location.method = 'get';
        location.href   = 'https://www.cocomatch.info/trigger/updatetrigger/?q=' + id;
    });

    jQuery('a.usebt').click(function() {
        var flag = jQuery(this).attr('value');
        var id = jQuery(this).parent('td').parent('tr').attr('id');
        if (flag == 1) {
            flag = 0;
        } else {
            flag = 1;
        }
        var ref = '/pattern/lists/';
        location.method = 'get';
        location.href   = 'https://www.cocomatch.info/trigger/updateflaguse/?q=' + id + '&f=' + flag + '&ref=' + ref;;
    });
});
