$(document).ready(function() {
    $('#addTestimonialFrom').formValidation({
        framework: 'bootstrap',
        icon: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            name: {
                validators: {
                    notEmpty: {
                        message: 'Please Enter Client Name'
                    },
                }
            },
            description: {
                validators: {
                    notEmpty: {
                        message: 'Please Enter Description'
                    },
                }
            },
        }
    });
    $('#addAdminFrom').formValidation({
        framework : 'bootstrap',
        icon: {
            valid : 'glyphicon glyphicon-ok',
            invalid : 'glyphicon glyphicon-remove',
            validation : 'glyphicon glyphicon-refresh'
        },
        fields : {
            name : {
                validators : {
                    notEmpty : {
                        message : 'Name is required'
                    },
                }
            },
            email : {
                validators : {
                    notEmpty : {
                        message : 'Email is required'
                    },
                }
            },
            password : {
                validators : {
                    notEmpty : {
                        message : 'Password is required'
                    },
                }
            },
            mobile_no : {
                validators : {
                    notEmpty : {
                        message : 'Mobile number is required'
                    },
                    regexp: {
                        regexp: /^[0-9]+$/i,
                        message: 'Mobile number can consist only numeric characters'
                    },
                    stringLength: {
                        min: 8,
                        max: 8,
                        message: 'Mobile number length should 8 characters'
                    }
                }
            },
        }
    });  

    $('#addProductFrom').formValidation({



        framework: 'bootstrap',



        icon: {



            valid: 'glyphicon glyphicon-ok',



            invalid: 'glyphicon glyphicon-remove',



            validating: 'glyphicon glyphicon-refresh'



        },



        fields: {



            product_name: {



                validators: {



                    notEmpty: {



                        message: 'The Product Name is required'



                    },



                    // regexp: {



                    //     regexp: /^[^*|\":<>[\]{}`\\()';@&$]+$/,



                    //     message: 'The Product Name can only consist of alphabetical charecters'



                    // },



                }



            },



            // product_sku : {



            //     validators: {



            //         notEmpty: {



            //             message: 'The Product Sku is required'



            //         }



            //     }



            // },



            product_price : {



                validators: {



                    notEmpty: {



                        message: 'The Product Price is required'



                    },



                    numeric: {



                        message: 'The Product Price must be a number'



                    }



                }



            },



            product_sale_price : {



                validators: {

                    numeric: {



                        message: 'The Product Sale Price must be a number'



                    }



                }



            },



            product_stock : {



                validators: {

                    numeric: {



                        message: 'The Product Stock must be a number'



                    }



                }



            },



            // brand_name : {



            //     validators: {



            //         notEmpty: {



            //             message: 'The Brand Name is required'



            //         }



            //     }



            // },



            /*'product_photos[]' : {



                validators: {



                    choice: {



                        min: 1,



                        max: 1,



                        message: 'Please choose atleast 1 Product Photo'



                    }



                }



            },*/



            'product_category[]' : {



                validators: {



                    notEmpty: {



                        message: 'Product Category is required'



                    },



                    choice: {



                        min: 1,



                        message: 'Please select at least 1 product category'



                    }



                }



            },



            // 'product_photos[]' : {



            //     validators: {



            //         notEmpty: {



            //             message: 'Product Image is required'



            //         }



            //     }



            // },



            /*'product_subcategory[]' : {



                validators: {



                    notEmpty: {



                        message: 'Product Subcategory is required'



                    },



                    choice: {



                        min: 1,



                        message: 'Please choose atleast 1 Product Subcategory'



                    }



                }



            },*/



        }



    });



});







$(document).ready(function() {
    $('#addCategoryForm').formValidation({
        framework: 'bootstrap',
        icon: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            category: {
                validators: {
                    notEmpty: {
                        message: 'The Category Name is required'
                    },
                    // regexp: {
                    //     regexp: /^[^*|\":<>[\]{}`\\()';@&$]+$/,
                    //     message: 'The Category Name can only consist of alphabetical charecters'
                    // },
                }
            },
        }
    });

    $('#addSubCategoryForm').formValidation({
        framework: 'bootstrap',
        icon: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            c_id: {
                validators: {
                    notEmpty: {
                        message: 'Please Select Category'
                    },
                }
            },
            subcategory: {
                validators: {
                    notEmpty: {
                        message: 'The Sub Category Name is required'
                    },
                    regexp: {
                        regexp: /^[^*|\":<>[\]{}`\\()';@&$]+$/,
                        message: 'The Sub Category Name can only consist of alphabetical charecters'
                    },
                }
            },
        }
    });

    $('#uploadBannerForm').formValidation({
        framework: 'bootstrap',
        icon: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            image: {
                validators: {
                    notEmpty: {
                        message: 'Please Select Image'
                    },
                }
            }
        }
    });

    $('#uploadHomeCategoryBannerForm').formValidation({
        framework: 'bootstrap',
        icon: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            image: {
                validators: {
                    notEmpty: {
                        message: 'Please Select Image'
                    },
                }
            },
            category: {
                validators: {
                    notEmpty: {
                        message: 'Please Select Category'
                    },
                }
            }
        }
    });


    $('#couponForm').formValidation({
        framework: 'bootstrap',
        icon: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            coupon_code: {
                validators: {
                    notEmpty: {
                        message: 'Please Enter Coupon Code'
                    },
                }
            },
            coupon_amount: {
                validators: {
                    notEmpty: {
                        message: 'Please Enter Coupon Amount'
                    },
                    numeric: {
                        message: 'The Coupon Amount must be a number'
                    },
                }
            },
            coupon_quantity: {
                validators: {
                    notEmpty: {
                        message: 'Please Enter Coupon Quantity'
                    },
                    numeric: {
                        message: 'The Coupon Quantity must be a number'
                    },
                }
            },
            cart_amount: {
                validators: {
                    notEmpty: {
                        message: 'Please Enter Min Cart Amount'
                    },
                    numeric: {
                        message: 'The Cart Amount must be a number'
                    },
                }
            },
            coupon_expiry_date: {
                validators: {
                    notEmpty: {
                        message: 'Please Enter Expiry Date'
                    },
                }
            },
        }
    });



});