Subversion Repositories SmartDukaan

Rev

Rev 18146 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<div class="container userprofile">
        <div class="row">
                <?php echo $this->element('unlikemodal');?>
                <div class="telecaller">
                        <?php if(!empty($user['User']['profile_pic'])):?>
                                <img class="img img-rounded" src="<?php echo $base_url;?>app/webroot/timthumb.php?src=<?php echo urlencode ($user['User']['profile_pic']);?>&h=120"/>
                        <?php else:?>
                                <img src="<?php echo $base_url;?>app/webroot/timthumb.php?src=<?php echo $base_url;?>img/noimage.png&h=120" alt="<?php echo $user['User']['username'];?>"/>
                        <?php endif;?>
                </div>
                <div class="editable text-center first_name" data-url="/users/edit/" data-id="<?php echo $user['User']['id'];?>" data-field="first_name" data-placeholder="Please enter your name"><?php echo !empty($user['User']['first_name'])?$user['User']['first_name']:'Your Name';?></div>
                <div class="card address">
                        <span class="profilelabel">Ph:</span> <div class="mobile_number inline" data-url="/users/edit/" data-id="<?php echo $user['User']['id'];?>" data-field="mobile_number" data-placeholder="Please enter your mobile number"><?php echo $user['User']['mobile_number'];?></div>
                        <?php if(!empty($user['User']['address_line_1'])):?>
                                <div class="editable" data-url="/users/edit/" data-id="<?php echo $user['User']['id'];?>" data-field="address_line_1" data-placeholder="Address Line 1"><?php echo $user['User']['address_line_1'];?></div>
                        <?php else:?>
                                <div class="editable" data-url="/users/edit/" data-id="<?php echo $user['User']['id'];?>" data-field="address_line_1" data-placeholder="Address Line 1">Address Line 1</div>
                        <?php endif;?>
                        <?php if(!empty($user['User']['address_line_2'])):?>
                                <div class="editable" data-url="/users/edit/" data-id="<?php echo $user['User']['id'];?>" data-field="address_line_2" data-placeholder="Address Line 2"><?php echo $user['User']['address_line_2'];?></div>
                        <?php else:?>
                                <div class="editable" data-url="/users/edit/" data-id="<?php echo $user['User']['id'];?>" data-field="address_line_2" data-placeholder="Address Line 2">Address Line 2</div>
                        <?php endif;?>
                        <?php if(!empty($user['User']['city'])):?>
                                <div class="editable inline" data-url="/users/edit/" data-id="<?php echo $user['User']['id'];?>" data-field="city" data-placeholder="City"><?php echo $user['User']['city'];?></div>
                        <?php else:?>
                                <div class="editable inline" data-url="/users/edit/" data-id="<?php echo $user['User']['id'];?>" data-field="city" data-placeholder="City">City</div>
                        <?php endif;?> - 
                        <?php if(!empty($user['User']['pincode'])):?>
                                <div class="editable inline" data-url="/users/edit/" data-id="<?php echo $user['User']['id'];?>" data-field="pincode" data-placeholder="Pincode"><?php echo $user['User']['pincode'];?></div>
                        <?php else:?>
                                <div class="editable inline" data-url="/users/edit/" data-id="<?php echo $user['User']['id'];?>" data-field="pincode" data-placeholder="Pincode">Pincode</div>
                        <?php endif;?>
                        <?php if(!empty($user['User']['state'])):?>
                                <div class="editable" data-url="/users/edit/" data-id="<?php echo $user['User']['id'];?>" data-field="state" data-placeholder="State"><?php echo $user['User']['state'];?></div>
                        <?php else:?>
                                <div class="editable" data-url="/users/edit/" data-id="<?php echo $user['User']['id'];?>" data-field="state" data-placeholder="State">State</div>
                        <?php endif;?>
                </div>
                <div class="editbtn">
                        <span class="editall"><i class="glyphicon glyphicon-pencil"></i> Edit</span> 
                </div>
        </div>
</div>  
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/js/jquery.jscroll.min.js?v=<?php echo $staticversion;?>"></script>
<script type="text/javascript" src="/js/profittill.js?v=<?php echo $staticversion;?>"></script>
<script type="text/javascript" src="<?php echo $base_url;?>js/jquery.editable.min.js"></script>
<script type="text/javascript">
$(function(){
        $('.editbtn').on('click',function(){
                $('.editable').each(function(){
                        $(this).toggleClass('form-control');
                });     
        });
        $('.editable').editable({
            touch : true, // Whether or not to support touch (default true)
            lineBreaks : false, // Whether or not to convert \n to <br /> (default true)
            toggleFontSize : false, // Whether or not it should be possible to change font size (default true),
            closeOnEnter : false, // Whether or not pressing the enter key should close the editor (default false)
            event : 'click', // The event that triggers the editor (default dblclick)
            tinyMCE : false, // Integrate with tinyMCE by settings this option to true or an object containing your tinyMCE configuration
            //emptyMessage : '<em>'+$(this).data('placeholder')+'</em>', // HTML that will be added to the editable element in case it gets empty (default false)
            callback : function( data ) {
                // Callback that will be called once the editor is blurred
                if( data.content ) {
                        $('#loadingModal').modal('show');
                    var field = data.$el.data('field');
                    var params = {};
                    params['id'] = data.$el.data('id');
                    params[field] = data.content;
                    $.post(data.$el.data('url')+data.$el.data('id'),params,function(data){
                                                if(data.result.success){
                                                        $('#loadingModal').modal('hide');
                                                }
                                        },'json'); 
                }
                if( data.fontSize ) {
                    // the font size has changed
                }

                // data.$el gives you a reference to the element that was edited
                // data.$el.effect('blink');
            }
        });
});
</script>