resources/assets/js/custom.js
/**
     * Get establishment data based on inputs
     * @constructor
     */
Get establishment data based on inputs
@constructor
Get establishment data based on inputs @constructor
function molConnect(error_out, success_out) {
        $(".form-body .alert-danger").remove();
        var labour_office_no = $("#labour_office_no").val();
        var sequence_no = $("#sequence_no").val();
        var id_number = $("#id_number").val();
        if (!id_number || !sequence_no || !labour_office_no) {
            toastr.error("", missing_required_fields);
            return;
        }
        var params = "?labour_office_no=" + labour_office_no + "&sequence_no=" + sequence_no + "&id_number=" + id_number;
        $.ajax({
            url: $(location).attr('href') + "/establishmentData" + params
            , success: function (data) {
                if (data.status == true) {
                    $("#name").val(data.est.name);
                    $("#est_activity").val(data.est.economic_activity);
                    $("#est_size").val(data.est.size_id);
                    $("#est_nitaq").val(data.est.nitaqat_color);
                    $("#district").val(data.est.district);
                    $("#city").val(data.est.city);
                    $("#region").val(data.est.region);
                    var address = data.est.street + "-" + data.est.region + "-" + data.est.city;
                    $("#wasel_address").val(address);
                    $("#local_liecense_no").val(data.est.cr_number);
                    $("#phone").val(data.est.phone);
                    toastr.success('', success_out);
                } else {
                    toastr.error('', error_out);
                }
            }
            , error: function (data) {
                toastr.error('', error_out);
            }
        });
    }
function molConnect ( error_out , success_out ) { $ ( ".form-body .alert-danger" ) . remove ( ) ; var labour_office_no = $ ( "#labour_office_no" ) . val ( ) ; var sequence_no = $ ( "#sequence_no" ) . val ( ) ; var id_number = $ ( "#id_number" ) . val ( ) ; if ( ! id_number || ! sequence_no || ! labour_office_no ) { toastr . error ( "" , missing_required_fields ) ; return ; } var params = "?labour_office_no=" + labour_office_no + "&sequence_no=" + sequence_no + "&id_number=" + id_number ; $ . ajax ( { url : $ ( location ) . attr ( 'href' ) + "/establishmentData" + params , success : function ( data ) { if ( data . status == true ) { $ ( "#name" ) . val ( data . est . name ) ; $ ( "#est_activity" ) . val ( data . est . economic_activity ) ; $ ( "#est_size" ) . val ( data . est . size_id ) ; $ ( "#est_nitaq" ) . val ( data . est . nitaqat_color ) ; $ ( "#district" ) . val ( data . est . district ) ; $ ( "#city" ) . val ( data . est . city ) ; $ ( "#region" ) . val ( data . est . region ) ; var address = data . est . street + "-" + data . est . region + "-" + data . est . city ; $ ( "#wasel_address" ) . val ( address ) ; $ ( "#local_liecense_no" ) . val ( data . est . cr_number ) ; $ ( "#phone" ) . val ( data . est . phone ) ; toastr . success ( '' , success_out ) ; } else { toastr . error ( '' , error_out ) ; } } , error : function ( data ) { toastr . error ( '' , error_out ) ; } } ) ; }
Get establishment data based on inputs
 @constructor
Get establishment data based on inputs @constructor
//$("#labour_office_no").val(data.est.labor_office_id); //$("#sequence_no").val(data.est.sequence_number); //$("#id_number").val(data.est.FK_establishment_id);