コード例 #1
0
function itemCustomHead()
{
    echo '<script type="text/javascript" src="' . osc_current_web_theme_js_url('jquery.validate.min.js') . '"></script>';
    echo '<script type="text/javascript" src="' . osc_current_web_theme_js_url('tabber-minimized.js') . '"></script>';
    ?>
        
        <?php 
    if (osc_images_enabled_at_items()) {
        ItemForm::photos_javascript();
    }
    ?>
        <?php 
}
コード例 #2
0
function itemCustomHead()
{
    echo '<script type="text/javascript" src="' . osc_current_web_theme_js_url('tabber-minimized.js') . '"></script>';
    ?>
        <?php 
    if (realestate_default_location_show_as() == 'dropdown') {
        ItemForm::location_javascript();
    } else {
        ItemForm::location_javascript_new();
    }
    ?>
        <?php 
    if (osc_images_enabled_at_items()) {
        ItemForm::photos_javascript();
    }
    ?>
        <!-- end only item-post.php -->
        <?php 
}
コード例 #3
0
ファイル: head.php プロジェクト: Ashishr2/Kathmandu
function getImage()
{
    if (getUrl() == osc_base_url()) {
        if (file_exists(WebThemes::newInstance()->getCurrentThemePath() . "images/logo.jpg")) {
            $image = osc_current_web_theme_url('images/logo.jpg');
        } else {
            $image = osc_current_web_theme_url('images/default-logo.jpg');
        }
    } else {
        if (osc_images_enabled_at_items()) {
            if (osc_count_item_resources() > 0) {
                $image = osc_resource_url();
            } else {
                $image = osc_current_web_theme_url('images/logo.jpg');
            }
        } else {
            $image = osc_current_web_theme_url('images/logo.jpg');
        }
    }
    return $image;
}
コード例 #4
0
ファイル: main.php プロジェクト: abhi143u11/ads
                        <?php 
if (osc_count_latest_items() == 0) {
    ?>
                            <?php 
    _e('No listings', 'flatter');
    ?>
                        <?php 
} else {
    ?>
                        <?php 
    while (osc_has_latest_items()) {
        ?>
                        <div class="item wow fadeInUp animated">
                            <div class="list">
                                <?php 
        if (osc_images_enabled_at_items()) {
            ?>
                                <div class="image">
                                    <div>
                                    <?php 
            if (osc_count_item_resources()) {
                ?>
                                    <a href="<?php 
                echo osc_item_url();
                ?>
"><img src="<?php 
                echo osc_resource_preview_url();
                ?>
" alt="<?php 
                echo osc_item_title();
                ?>
コード例 #5
0
    public static function location_javascript($path = "front")
    {
        ?>
<script type="text/javascript">
    $(document).ready(function(){
        $("#countryId").live("change",function(){
            var pk_c_code = $(this).val();
            <?php 
        if ($path == "admin") {
            ?>
                var url = '<?php 
            echo osc_admin_base_url(true) . "?page=ajax&action=regions&countryId=";
            ?>
' + pk_c_code;
            <?php 
        } else {
            ?>
                var url = '<?php 
            echo osc_base_url(true) . "?page=ajax&action=regions&countryId=";
            ?>
' + pk_c_code;
            <?php 
        }
        ?>
            var result = '';

            if(pk_c_code != '') {

                $("#regionId").attr('disabled',false);
                $("#cityId").attr('disabled',true);

                $.ajax({
                    type: "POST",
                    url: url,
                    dataType: 'json',
                    success: function(data){
                        var length = data.length;
                        
                        if(length > 0) {

                            result += '<option value=""><?php 
        _e("Select a region...");
        ?>
</option>';
                            for(key in data) {
                                result += '<option value="' + data[key].pk_i_id + '">' + data[key].s_name + '</option>';
                            }

                            $("#region").before('<select name="regionId" id="regionId" ></select>');
                            $("#region").remove();

                            $("#city").before('<select name="cityId" id="cityId" ></select>');
                            $("#city").remove();
                            
                            $("#regionId").val("");

                        } else {

                            $("#regionId").before('<input type="text" name="region" id="region" />');
                            $("#regionId").remove();
                            
                            $("#cityId").before('<input type="text" name="city" id="city" />');
                            $("#cityId").remove();
                            
                        }

                        $("#regionId").html(result);
                        $("#cityId").html('<option selected value=""><?php 
        _e("Select a city...");
        ?>
</option>');
                    }
                 });

             } else {

                 // add empty select
                 $("#region").before('<select name="regionId" id="regionId" ><option value=""><?php 
        _e("Select a region...");
        ?>
</option></select>');
                 $("#region").remove();
                 
                 $("#city").before('<select name="cityId" id="cityId" ><option value=""><?php 
        _e("Select a city...");
        ?>
</option></select>');
                 $("#city").remove();

                 if( $("#regionId").length > 0 ){
                     $("#regionId").html('<option value=""><?php 
        _e("Select a region...");
        ?>
</option>');
                 } else {
                     $("#region").before('<select name="regionId" id="regionId" ><option value=""><?php 
        _e("Select a region...");
        ?>
</option></select>');
                     $("#region").remove();
                 }
                 if( $("#cityId").length > 0 ){
                     $("#cityId").html('<option value=""><?php 
        _e("Select a city...");
        ?>
</option>');
                 } else {
                     $("#city").before('<select name="cityId" id="cityId" ><option value=""><?php 
        _e("Select a city...");
        ?>
</option></select>');
                     $("#city").remove();
                 }
                 $("#regionId").attr('disabled',true);
                 $("#cityId").attr('disabled',true);
             }
        });

        $("#regionId").live("change",function(){
            var pk_c_code = $(this).val();
            <?php 
        if ($path == "admin") {
            ?>
                var url = '<?php 
            echo osc_admin_base_url(true) . "?page=ajax&action=cities&regionId=";
            ?>
' + pk_c_code;
            <?php 
        } else {
            ?>
                var url = '<?php 
            echo osc_base_url(true) . "?page=ajax&action=cities&regionId=";
            ?>
' + pk_c_code;
            <?php 
        }
        ?>

            var result = '';

            if(pk_c_code != '') {
                
                $("#cityId").attr('disabled',false);
                $.ajax({
                    type: "POST",
                    url: url,
                    dataType: 'json',
                    success: function(data){
                        var length = data.length;
                        if(length > 0) {
                            result += '<option selected value=""><?php 
        _e("Select a city...");
        ?>
</option>';
                            for(key in data) {
                                result += '<option value="' + data[key].pk_i_id + '">' + data[key].s_name + '</option>';
                            }

                            $("#city").before('<select name="cityId" id="cityId" ></select>');
                            $("#city").remove();
                        } else {
                            result += '<option value=""><?php 
        _e('No results');
        ?>
</option>';
                            $("#cityId").before('<input type="text" name="city" id="city" />');
                            $("#cityId").remove();
                        }
                        $("#cityId").html(result);
                    }
                 });
             } else {
                $("#cityId").attr('disabled',true);
             }
        });

        if( $("#regionId").attr('value') == "")  {
            $("#cityId").attr('disabled',true);
        }

        if($("#countryId").length != 0) {
            if( $("#countryId").attr('type').match(/select-one/) ) {
                if( $("#countryId").attr('value') == "")  {
                    $("#regionId").attr('disabled',true);
                }
            }
        }

        /**
         * Validate form
         */

        // Validate description without HTML.
        $.validator.addMethod(
            "minstriptags",
            function(value, element) {
                altered_input = strip_tags(value);
                if (altered_input.length < 3) {
                    return false;
                } else {
                    return true;
                }
            },
            "<?php 
        _e("Description: needs to be longer");
        ?>
."
        );

        // Code for form validation
        $("form[name=item]").validate({
            rules: {
                catId: {
                    required: true,
                    digits: true
                },
                <?php 
        if (osc_price_enabled_at_items()) {
            ?>
                price: {
                    maxlength: 15
                },
                currency: "required",
                <?php 
        }
        ?>
                <?php 
        if (osc_images_enabled_at_items()) {
            ?>
                "photos[]": {
                    accept: "<?php 
            echo osc_allowed_extension();
            ?>
"
                },
                <?php 
        }
        ?>
                <?php 
        if ($path == 'front') {
            ?>
                contactName: {
                    minlength: 3,
                    maxlength: 35
                },
                contactEmail: {
                    required: true,
                    email: true
                },
                <?php 
        }
        ?>
                regionId: {
                    required: true,
                    digits: true
                },
                cityId: {
                    required: true,
                    digits: true
                },
                cityArea: {
                    minlength: 3,
                    maxlength: 50
                },
                address: {
                    minlength: 3,
                    maxlength: 100
                }
            },
            messages: {
                catId: "<?php 
        _e('Choose one category');
        ?>
.",
                <?php 
        if (osc_price_enabled_at_items()) {
            ?>
                price: {
                    maxlength: "<?php 
            _e("Price: no more than 50 characters");
            ?>
."
                },
                currency: "<?php 
            _e("Currency: make your selection");
            ?>
.",
                <?php 
        }
        ?>
                <?php 
        if (osc_images_enabled_at_items()) {
            ?>
                "photos[]": {
                    accept: "<?php 
            printf(__("Photo: must be %s"), osc_allowed_extension());
            ?>
."
                },
                <?php 
        }
        ?>
                <?php 
        if ($path == 'front') {
            ?>
                contactName: {
                    minlength: "<?php 
            _e("Name: enter at least 3 characters");
            ?>
.",
                    maxlength: "<?php 
            _e("Name: no more than 35 characters");
            ?>
."
                },
                contactEmail: {
                    required: "<?php 
            _e("Email: this field is required");
            ?>
.",
                    email: "<?php 
            _e("Invalid email address");
            ?>
."
                },
                <?php 
        }
        ?>
                regionId: "<?php 
        _e("Select a region");
        ?>
.",
                cityId: "<?php 
        _e("Select a city");
        ?>
.",
                cityArea: {
                    minlength: "<?php 
        _e("City area: enter at least 3 characters");
        ?>
.",
                    maxlength: "<?php 
        _e("City area: no more than 50 characters");
        ?>
."
                },
                address: {
                    minlength: "<?php 
        _e("Address: enter at least 3 characters");
        ?>
.",
                    maxlength: "<?php 
        _e("Address: no more than 100 characters");
        ?>
."
                }
            },
            errorLabelContainer: "#error_list",
            wrapper: "li",
            invalidHandler: function(form, validator) {
                $('html,body').animate({ scrollTop: $('h1').offset().top }, { duration: 250, easing: 'swing'});
            }
        });
    });

    /**
     * Strip HTML tags to count number of visible characters.
     */
    function strip_tags(html) {
        if (arguments.length < 3) {
            html=html.replace(/<\/?(?!\!)[^>]*>/gi, '');
        } else {
            var allowed = arguments[1];
            var specified = eval("["+arguments[2]+"]");
            if (allowed){
                var regex='</?(?!(' + specified.join('|') + '))\b[^>]*>';
                html=html.replace(new RegExp(regex, 'gi'), '');
            } else{
                var regex='</?(' + specified.join('|') + ')\b[^>]*>';
                html=html.replace(new RegExp(regex, 'gi'), '');
            }
        }
        return html;
    }
    
    function delete_image(id, item_id,name, secret) {
        //alert(id + " - "+ item_id + " - "+name+" - "+secret);
        var result = confirm('<?php 
        echo osc_esc_js(__("This action can't be undone. Are you sure you want to continue?"));
        ?>
');
        if(result) {
            $.ajax({
                type: "POST",
                url: '<?php 
        echo osc_base_url(true);
        ?>
?page=ajax&action=delete_image&id='+id+'&item='+item_id+'&code='+name+'&secret='+secret,
                dataType: 'json',
                success: function(data){
                    var class_type = "error";
                    if(data.success) {
                        $("div[name="+name+"]").remove();
                        class_type = "ok";
                    }
                    var flash = $("#flash_js");
                    var message = $('<div>').addClass('pubMessages').addClass(class_type).attr('id', 'FlashMessage').html(data.msg);
                    flash.html(message);
                    $("#FlashMessage").slideDown('slow').delay(3000).slideUp('slow');
                }
            });
        }
    }
    
    
</script>
<?php 
    }
コード例 #6
0
ファイル: settings.php プロジェクト: mylastof/os-class
</div>
                            <div class="form-controls">
                                <div class="form-label-checkbox">
                                    <label>
                                        <input type="checkbox" <?php 
echo osc_price_enabled_at_items() ? 'checked="checked"' : '';
?>
 name="enableField#f_price@items" value="1"  />
                                        <?php 
_e('Price');
?>
                                    </label>
                                    <div class="separate-top-medium">
                                        <label>
                                            <input type="checkbox" <?php 
echo osc_images_enabled_at_items() ? 'checked="checked"' : '';
?>
 name="enableField#images@items" value="1" />
                                            <?php 
_e('Attach images');
?>
                                        </label>
                                    </div>
                                    <div class="separate-top-medium">
                                        <?php 
printf(__('Attach %s images per listing'), '<input type="text" class="input-small" name="numImages@items" value="' . osc_max_images_per_item() . '" />');
?>
                                        <div class="help-box"><?php 
_e('If the value is zero, it means an unlimited number of images is allowed');
?>
</div>
コード例 #7
0
    public static function location_javascript($path = "front")
    {
        ?>
<script type="text/javascript">
    $(document).ready(function(){
        $("#countryId").change(function(){
            var pk_c_code = $(this).val();
            <?php 
        if ($path == "admin") {
            ?>
                var url = '<?php 
            echo osc_admin_base_url(true) . "?page=ajax&action=regions&countryId=";
            ?>
' + pk_c_code;
            <?php 
        } else {
            ?>
                var url = '<?php 
            echo osc_base_url(true) . "?page=ajax&action=regions&countryId=";
            ?>
' + pk_c_code;
            <?php 
        }
        ?>
            var result = '';

            if(pk_c_code != '') {
                $("#regionId").attr('disabled',false);
                $("#cityId").attr('disabled',true);
                $.ajax({
                    type: "POST",
                    url: url,
                    dataType: 'json',
                    success: function(data){
                        var length = data.length;
                        if(length > 0) {
                            result += '<option value=""><?php 
        _e("Select a region...");
        ?>
</option>';
                            for(key in data) {
                                result += '<option value="' + data[key].pk_i_id + '">' + data[key].s_name + '</option>';
                            }
                            $("#region").before('<select name="regionId" id="regionId" ></select>');
                            $("#region").remove();
                        } else {
                            result += '<option value=""><?php 
        _e('No results');
        ?>
</option>';
                            $("#regionId").before('<input type="text" name="region" id="region" />');
                            $("#regionId").remove();
                        }
                        $("#regionId").html(result);
                    }
                 });
             } else {
                $("#regionId").attr('disabled',true);
                $("#cityId").attr('disabled',true);
             }
        });


        $("#regionId").change(function(){
            var pk_c_code = $(this).val();
            <?php 
        if ($path == "admin") {
            ?>
                var url = '<?php 
            echo osc_admin_base_url(true) . "?page=ajax&action=cities&regionId=";
            ?>
' + pk_c_code;
            <?php 
        } else {
            ?>
                var url = '<?php 
            echo osc_base_url(true) . "?page=ajax&action=cities&regionId=";
            ?>
' + pk_c_code;
            <?php 
        }
        ?>

            var result = '';

            if(pk_c_code != '') {
                $("#cityId").attr('disabled',false);
                $.ajax({
                    type: "POST",
                    url: url,
                    dataType: 'json',
                    success: function(data){
                        var length = data.length;
                        if(length > 0) {
                            result += '<option value=""><?php 
        _e("Select a city...");
        ?>
</option>';
                            for(key in data) {
                                result += '<option value="' + data[key].pk_i_id + '">' + data[key].s_name + '</option>';
                            }
                            $("#city").before('<select name="cityId" id="cityId" ></select>');
                            $("#city").remove();
                        } else {
                            result += '<option value=""><?php 
        _e('No results');
        ?>
</option>';
                            $("#cityId").before('<input type="text" name="city" id="city" />');
                            $("#cityId").remove();
                        }
                        $("#cityId").html(result);
                    }
                 });
             } else {
                $("#cityId").attr('disabled',true);
             }
        });


        if( $("#regionId").attr('value') == "")  {
            $("#cityId").attr('disabled',true);
        }
        
        if( $("#countryId").attr('type').match(/select-one/) ) {
            if( $("#countryId").attr('value') == "")  {
                $("#regionId").attr('disabled',true);
            }
        }
    
        /**
         * Validate form
         */
         
        // Validate description without HTML.
        $.validator.addMethod(
            "minstriptags", 
            function(value, element) { 
                altered_input = strip_tags(value);
                if (altered_input.length < 10) {
                    return false;
                } else {
                    return true;
                }
            }, 
            "<?php 
        _e("Description: needs to be longer");
        ?>
."
        );
        
        // Validate fields in each locale.
        $("form[name=item] button").click(function() {
            lang_count = $(".title input").length;
            // Title
            $(".title input").each(function(){
                lang_name   = $(this).parent().prev('h2').text().replace(/^(.+) \((.+)\)$/, '$1');
                lang_locale = $(this).attr('name').replace(/^title\[(.+)\]$/,'$1');

                str = ((lang_count > 1) ? lang_name + ' ' : '');
                $(this).rules("add", {
                    required: true,
                    minlength: 9,
                    maxlength: 80,
                    messages: {
                        required: str + "<?php 
        _e("Title: this field is required");
        ?>
.",
                        minlength: str + "<?php 
        _e("Title: enter at least 9 characters");
        ?>
.",
                        maxlength: str + "<?php 
        _e("Title: no more than 80 characters");
        ?>
."
                    }
                });                   
            });
            // Description
            $(".description textarea").each(function(){
                lang_name   = $(this).parent().prev('h2').text().replace(/^(.+) \((.+)\)$/, '$1');
                lang_locale = $(this).attr('name').replace(/^title\[(.+)\]$/,'$1');

                str = ((lang_count > 1) ? lang_name + ' ' : '');
                $(this).rules("add", {
                    required: true,
                    minlength: 10,
                    maxlength: 5000,
                    'minstriptags': true,
                    messages: {
                        required: str + "<?php 
        _e("Description: this field is required");
        ?>
.",
                        minlength: str + "<?php 
        _e("Description: needs to be longer");
        ?>
.",
                        maxlength: str + "<?php 
        _e("Description: no more than 5000 characters");
        ?>
."
                    }
                });                   
            });
        });
        
        // Code for form validation
        $("form[name=item]").validate({
            rules: {
                catId: {
                    required: true,
                    digits: true
                },
                <?php 
        if (osc_price_enabled_at_items()) {
            ?>
                price: {
                    number: true,
                    maxlength: 15
                },
                currency: "required",
                <?php 
        }
        ?>
                <?php 
        if (osc_images_enabled_at_items()) {
            ?>
                "photos[]": {
                    accept: "<?php 
            echo osc_allowed_extension();
            ?>
"
                },
                <?php 
        }
        ?>
                <?php 
        if ($path == 'front') {
            ?>
                contactName: {
                    minlength: 3,
                    maxlength: 35
                },
                contactEmail: {
                    required: true,
                    email: true
                },
                <?php 
        }
        ?>
                regionId: {
                    required: true,
                    digits: true
                },
                cityId: {
                    required: true,
                    digits: true
                },
                cityArea: {
                    minlength: 3,
                    maxlength: 35
                },
                address: {
                    minlength: 5,
                    maxlength: 50
                }
            },
            messages: {
                catId: "<?php 
        _e('Choose one category');
        ?>
.",
                <?php 
        if (osc_price_enabled_at_items()) {
            ?>
                price: {
                    number: "<?php 
            _e('Price: enter a valid number');
            ?>
.",
                    maxlength: "<?php 
            _e("Price: no more than 15 characters");
            ?>
."
                },
                currency: "<?php 
            _e("Currency: make your selection");
            ?>
.",
                <?php 
        }
        ?>
                <?php 
        if (osc_images_enabled_at_items()) {
            ?>
                "photos[]": {
                    accept: "<?php 
            printf(__("Photo: must be %s"), osc_allowed_extension());
            ?>
."
                },
                <?php 
        }
        ?>
                <?php 
        if ($path == 'front') {
            ?>
                contactName: {
                    minlength: "<?php 
            _e("Name: enter at least 3 characters");
            ?>
.",
                    maxlength: "<?php 
            _e("Name: no more than 35 characters");
            ?>
."
                },
                contactEmail: {
                    required: "<?php 
            _e("Email: this field is required");
            ?>
.",
                    email: "<?php 
            _e("Invalid email address");
            ?>
."
                },
                <?php 
        }
        ?>
                regionId: "<?php 
        _e("Select a region");
        ?>
.",
                cityId: "<?php 
        _e("Select a city");
        ?>
.",
                cityArea: {
                    minlength: "<?php 
        _e("City area: enter at least 3 characters");
        ?>
.",
                    maxlength: "<?php 
        _e("City area: no more than 35 characters");
        ?>
."
                },
                address: {
                    minlength: "<?php 
        _e("Address: enter at least 5 characters");
        ?>
.",
                    maxlength: "<?php 
        _e("Address: no more than 50 characters");
        ?>
."
                }
            },
            errorLabelContainer: "#error_list",
            wrapper: "li",
            invalidHandler: function(form, validator) {
                $('html,body').animate({ scrollTop: $('h1').offset().top }, { duration: 250, easing: 'swing'});
            }
        });
    });

    /**
     * Strip HTML tags to count number of visible characters.
     */
    function strip_tags(html) {
        if (arguments.length < 3) {
            html=html.replace(/<\/?(?!\!)[^>]*>/gi, '');
        } else {
            var allowed = arguments[1];
            var specified = eval("["+arguments[2]+"]");
            if (allowed){
                var regex='</?(?!(' + specified.join('|') + '))\b[^>]*>';
                html=html.replace(new RegExp(regex, 'gi'), '');
            } else{
                var regex='</?(' + specified.join('|') + ')\b[^>]*>';
                html=html.replace(new RegExp(regex, 'gi'), '');
            }
        }
        return html;
    }
</script>
<?php 
    }
コード例 #8
0
ファイル: frm.php プロジェクト: jmcclenon/Osclass
function customHead()
{
    ?>
        <script type="text/javascript">

            document.write('<style type="text/css"> .tabber{ display:none; } </style>');
            $(document).ready(function(){
                $('input[name="user"]').attr( "autocomplete", "off" );
                $('#user,#fUser').autocomplete({
                    source: "<?php 
    echo osc_admin_base_url(true);
    ?>
?page=ajax&action=userajax",
                    minLength: 0,
                    select: function( event, ui ) {
                        if(ui.item.id=='') {
                            $("#contact_info").show();
                            return false;
                        }
                        $('#userId').val(ui.item.id);
                        $('#fUserId').val(ui.item.id);
                        $("#contact_info").hide();
                    }
                });

                <?php 
    if (osc_locale_thousands_sep() != '' || osc_locale_dec_point() != '') {
        ?>
                $("#price").blur(function(event) {
                    var price = $("#price").attr("value");
                    <?php 
        if (osc_locale_thousands_sep() != '') {
            ?>
                    while(price.indexOf('<?php 
            echo osc_esc_js(osc_locale_thousands_sep());
            ?>
')!=-1) {
                        price = price.replace('<?php 
            echo osc_esc_js(osc_locale_thousands_sep());
            ?>
', '');
                    }
                    <?php 
        }
        ?>
                    <?php 
        if (osc_locale_dec_point() != '') {
            ?>
                    var tmp = price.split('<?php 
            echo osc_esc_js(osc_locale_dec_point());
            ?>
');
                    if(tmp.length>2) {
                        price = tmp[0]+'<?php 
            echo osc_esc_js(osc_locale_dec_point());
            ?>
'+tmp[1];
                    }
                    <?php 
        }
        ?>
                    $("#price").attr("value", price);
                });
                <?php 
    }
    ?>
            });
        </script>
        <?php 
    ItemForm::location_javascript_new('admin');
    ?>
        <?php 
    if (osc_images_enabled_at_items()) {
        ItemForm::photos_javascript();
    }
    ?>
        <?php 
}
コード例 #9
0
ファイル: item.php プロジェクト: nsswaga/OSClass
        echo osc_item_meta_value();
        ?>
                            </p>
                            <?php 
    }
    ?>
                        </div>
                        <?php 
}
?>
                    </div>
                    <?php 
osc_run_hook('item_detail', osc_item());
?>
                    <?php 
if (osc_images_enabled_at_items() && osc_count_item_resources() > 0) {
    ?>
                    <div class="photos">
                        <ul class="media-grid">
                        <?php 
    while (osc_has_item_resources()) {
        ?>
                            <li>
                                <a rel="image_group" href="<?php 
        echo osc_resource_url();
        ?>
"><img src="<?php 
        echo osc_resource_thumbnail_url();
        ?>
" width="150" alt="<?php 
        echo osc_item_title();
コード例 #10
0
ファイル: functions.php プロジェクト: oanav/closetshare
function pop_search_filters()
{
    ?>
      <form id="filterForm" name="filterForm" action="<?php 
    echo osc_base_url(true);
    ?>
" method="get" class="nocsrf">
        <input type="hidden" name="page" value="search" />
        <input type="hidden" name="sOrder" value="<?php 
    echo osc_search_order();
    ?>
" />
        <input type="hidden" name="iOrderType" value="<?php 
    $allowedTypesForSorting = Search::getAllowedTypesForSorting();
    echo $allowedTypesForSorting[osc_search_order_type()];
    ?>
" />
        <?php 
    foreach (osc_search_user() as $userId) {
        ?>
        <input type="hidden" name="sUser[]" value="<?php 
        echo $userId;
        ?>
" />
        <?php 
    }
    ?>
        <fieldset class="form-group first">
            <h6>
                <?php 
    _e('Search text', 'pop');
    ?>
            </h6>
            <input class="input-text" type="text" name="sPattern" id="query" value="<?php 
    echo osc_esc_html(osc_search_pattern());
    ?>
" />
        </fieldset>
       
        <fieldset class="form-group">
            <h6>
                <?php 
    _e('Region', 'pop');
    ?>
            </h6>
            <div>
                <?php 
    $sCountries = osc_get_countries();
    $countryId = $sCountries[0]['pk_c_code'];
    $sRegions = osc_get_regions($countryId);
    ?>
               <?php 
    //pop_region_autocomplete($sRegions);
    ?>
                 <input type="hidden" id="countryId" name="countryId" value="<?php 
    echo $countryId;
    ?>
" />
                  <input class="input-text" type="text" id="region" name="sRegion" value="<?php 
    echo osc_esc_html(osc_search_region());
    ?>
" />
                <input type="hidden" id="regionId" name="regionId" />
            </div>
        </fieldset>
         <fieldset class="form-group">
            <h6>
                <?php 
    _e('City', 'pop');
    ?>
            </h6>
            <div>
                <input class="input-text" type="text" id="city" name="sCity" value="<?php 
    echo osc_esc_html(osc_search_city());
    ?>
" />
                 <input type="hidden" id="cityId" name="cityId" />
            </div>
        </fieldset>
        <?php 
    if (osc_images_enabled_at_items()) {
        ?>
        <fieldset class="form-group">
            <div class="checkbox">
                <input type="checkbox" name="bPic" id="withPicture" value="1" <?php 
        echo osc_search_has_pic() ? 'checked' : '';
        ?>
 />
                <label for="withPicture">
                    <?php 
        _e('Listings with pictures', 'pop');
        ?>
                </label>
            </div>
        </fieldset>
        <?php 
    }
    ?>
        <?php 
    if (osc_price_enabled_at_items()) {
        ?>
        <fieldset class="form-group">
            <div class="price-slice">
                <h6>
                    <?php 
        _e('Price', 'pop');
        ?>
                </h6>
                <ul class="row">
                    <li class="col-md-6"> <span>
                            <?php 
        _e('Min', 'pop');
        ?>
                   :</span>
                        <input class="input-text" type="text" id="priceMin" name="sPriceMin" value="<?php 
        echo osc_esc_html(osc_search_price_min());
        ?>
" size="6" maxlength="6" />
                    </li>
                    <li class="col-md-6"> <span>
                            <?php 
        _e('Max', 'pop');
        ?>
                   :</span>
                        <input class="input-text" type="text" id="priceMax" name="sPriceMax" value="<?php 
        echo osc_esc_html(osc_search_price_max());
        ?>
" size="6" maxlength="6" />
                    </li>
                </ul>
            </div>
        </fieldset>
        <?php 
    }
    ?>
          <div class="form-group plugin-hooks">
            <?php 
    if (osc_search_category_id()) {
        osc_run_hook('search_form', osc_search_category_id());
    } else {
        osc_run_hook('search_form');
    }
    ?>
        </div>
        <?php 
    $aCategories = osc_search_category();
    foreach ($aCategories as $cat_id) {
        ?>
        <input type="hidden" name="sCategory[]" value="<?php 
        echo osc_esc_html($cat_id);
        ?>
" />
        <?php 
    }
    ?>

        <div class="actions">
            <button type="submit" class="btn btn-primary">
                <?php 
    _e('Apply', 'pop');
    ?>
            </button>
            <a class="clear" onclick="formReset($('#filterForm'))">
            <i class="fa fa-times"></i><?php 
    echo _e('Clear filters', 'pop');
    ?>
</a>
        </div>
    </form>
<?php 
}
コード例 #11
0
ファイル: frm.php プロジェクト: ranjithinnergys/OSClass
function customHead()
{
    ?>
        <script type="text/javascript" src="<?php 
    echo osc_current_admin_theme_js_url('jquery.validate.min.js');
    ?>
"></script>
        <script type="text/javascript">
            document.write('<style type="text/css"> .tabber{ display:none; } </style>') ;
            $(document).ready(function(){
                $("#userId").bind('change', function() {
                    if($(this).val() == '') {
                        $("#contact_info").show() ;
                    } else {
                        $("#contact_info").hide() ;
                    }
                }) ;

                if( $("#userId").val() == '') {
                    $("#contact_info").show() ;
                } else {
                    $("#contact_info").hide() ;
                }

                <?php 
    if (osc_locale_thousands_sep() != '' || osc_locale_dec_point() != '') {
        ?>
                $("#price").blur(function(event) {
                    var price = $("#price").attr("value");
                    <?php 
        if (osc_locale_thousands_sep() != '') {
            ?>
                    while(price.indexOf('<?php 
            echo osc_esc_js(osc_locale_thousands_sep());
            ?>
')!=-1) {
                        price = price.replace('<?php 
            echo osc_esc_js(osc_locale_thousands_sep());
            ?>
', '');
                    }
                    <?php 
        }
        ?>
                    <?php 
        if (osc_locale_dec_point() != '') {
            ?>
                    var tmp = price.split('<?php 
            echo osc_esc_js(osc_locale_dec_point());
            ?>
');
                    if(tmp.length>2) {
                        price = tmp[0]+'<?php 
            echo osc_esc_js(osc_locale_dec_point());
            ?>
'+tmp[1];
                    }
                    <?php 
        }
        ?>
                    $("#price").attr("value", price);
                });
                <?php 
    }
    ?>
            });
        </script>
        <?php 
    ItemForm::location_javascript_new('admin');
    ?>
        <?php 
    if (osc_images_enabled_at_items()) {
        ItemForm::photos_javascript();
    }
    ?>
        <?php 
}
コード例 #12
0
ファイル: frm.php プロジェクト: syedfiraat4/bikade.com
function customHead()
{
    ?>
        <script type="text/javascript">

            document.write('<style type="text/css"> .tabber{ display:none; } </style>');
            $(document).ready(function(){
                $('input[name="user"]').attr( "autocomplete", "off" );
                $('#user,#fUser').autocomplete({
                    source: "<?php 
    echo osc_admin_base_url(true);
    ?>
?page=ajax&action=userajax",
                    minLength: 0,
                    select: function( event, ui ) {
                        if(ui.item.id=='') {
                            $("#contact_info").show();
                            return false;
                        }
                        $('#userId').val(ui.item.id);
                        $('#fUserId').val(ui.item.id);
                        $("#contact_info").hide();
                    }
                });

                $('.ui-autocomplete').css('zIndex', 10000);

                <?php 
    if (osc_locale_thousands_sep() != '' || osc_locale_dec_point() != '') {
        ?>
                $("#price").on("blur", function(event) {
                    var price = $("#price").prop("value");
                    <?php 
        if (osc_locale_thousands_sep() != '') {
            ?>
                    while(price.indexOf('<?php 
            echo osc_esc_js(osc_locale_thousands_sep());
            ?>
')!=-1) {
                        price = price.replace('<?php 
            echo osc_esc_js(osc_locale_thousands_sep());
            ?>
', '');
                    }
                    <?php 
        }
        ?>
                    <?php 
        if (osc_locale_dec_point() != '') {
            ?>
                    var tmp = price.split('<?php 
            echo osc_esc_js(osc_locale_dec_point());
            ?>
');
                    if(tmp.length>2) {
                        price = tmp[0]+'<?php 
            echo osc_esc_js(osc_locale_dec_point());
            ?>
'+tmp[1];
                    }
                    <?php 
        }
        ?>
                    $("#price").prop("value", price);

                });
                <?php 
    }
    ?>

                $('#update_expiration').change( function() {
                    if($(this).attr("checked")) {
                        $('#dt_expiration').prop('value', '');
                        $('div.update_expiration').show();
                    } else {
                        $('#dt_expiration').prop('value', '-1');
                        $('div.update_expiration').hide();
                    }
                });

                $('body').on("created", '[name^="select_"]',function(evt) {
                    selectUi($(this));
                });

            });
        </script>
        <?php 
    ItemForm::location_javascript('admin');
    ?>
        <?php 
    if (osc_images_enabled_at_items()) {
        ItemForm::photos_javascript();
    }
    ?>
        <?php 
}