1. JavaScript / Говнокод #16311

    +155

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    function createDataStringFromArray(data){
        dataName = "outputSyntax=plain"
        data.each(function(value, index){
            if(value.name == "register_first_name"){
                dataName = dataName + "&register_first_name=" + value.value;
            }else if(value.name == "register_last_name"){
                dataName = dataName + "&register_last_name=" + value.value;
            }else if(value.name == "etablishment"){
                dataName = dataName + "&etablishment=" + value.value;
            }else if(value.name == "function"){
                dataName = dataName + "&fonction=" + value.value;
            }else if(value.name == "element_id"){
                dataName = dataName + "&id=" + value.value;
            }else if(value.name == "mail"){
                dataName = dataName + "&register_email=" + value.value;
            }else if(value.name == "phone"){
                dataName = dataName + "&register_phone=" + value.value;
            }else if(value.name == "mobile"){
                dataName = dataName + "&register_mobile=" + value.value;
            }else if(value.name == "access"){
                dataName = dataName + "&access=" + value.value;
            }else if(value.name == "mail_alerts"){
                dataName = dataName + "&mail_alerts=" + value.value;
            }
        })
        return dataName;
    }

    Запостил: iofjuupasli, 11 Июля 2014

    Комментарии (1) RSS

    Добавить комментарий