Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
13740 anikendra 1
<div class="container userprofile">
13743 anikendra 2
	<div class="row">
3
		<?php echo $this->element('unlikemodal');?>
4
		<div class="telecaller">
5
			<?php if(!empty($user['User']['profile_pic'])):?>
17760 amit.gupta 6
				<img class="img img-rounded" src="<?php echo $base_url;?>app/webroot/timthumb.php?src=<?php echo urlencode ($user['User']['profile_pic']);?>&h=120"/>
13743 anikendra 7
			<?php else:?>
8
				<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'];?>"/>
9
			<?php endif;?>
10
		</div>
11
		<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>
12
		<div class="card address">
13752 anikendra 13
			<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>
13743 anikendra 14
			<?php if(!empty($user['User']['address_line_1'])):?>
15
				<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>
16
			<?php else:?>
17
				<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>
18
			<?php endif;?>
19
			<?php if(!empty($user['User']['address_line_2'])):?>
20
				<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>
21
			<?php else:?>
22
				<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>
23
			<?php endif;?>
24
			<?php if(!empty($user['User']['city'])):?>
25
				<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>
26
			<?php else:?>
27
				<div class="editable inline" data-url="/users/edit/" data-id="<?php echo $user['User']['id'];?>" data-field="city" data-placeholder="City">City</div>
28
			<?php endif;?> - 
29
			<?php if(!empty($user['User']['pincode'])):?>
30
				<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>
31
			<?php else:?>
13745 anikendra 32
				<div class="editable inline" data-url="/users/edit/" data-id="<?php echo $user['User']['id'];?>" data-field="pincode" data-placeholder="Pincode">Pincode</div>
13743 anikendra 33
			<?php endif;?>
34
			<?php if(!empty($user['User']['state'])):?>
35
				<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>
36
			<?php else:?>
37
				<div class="editable" data-url="/users/edit/" data-id="<?php echo $user['User']['id'];?>" data-field="state" data-placeholder="State">State</div>
38
			<?php endif;?>
39
		</div>
40
		<div class="editbtn">
41
			<span class="editall"><i class="glyphicon glyphicon-pencil"></i> Edit</span> 
42
		</div>
13740 anikendra 43
	</div>
44
</div>	
20706 amit.gupta 45
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
18146 amit.gupta 46
<script type="text/javascript" src="/js/jquery.jscroll.min.js?v=<?php echo $staticversion;?>"></script>
13743 anikendra 47
<script type="text/javascript" src="/js/profittill.js?v=<?php echo $staticversion;?>"></script>
13740 anikendra 48
<script type="text/javascript" src="<?php echo $base_url;?>js/jquery.editable.min.js"></script>
49
<script type="text/javascript">
50
$(function(){
13743 anikendra 51
	$('.editbtn').on('click',function(){
52
		$('.editable').each(function(){
53
			$(this).toggleClass('form-control');
54
		});	
55
	});
13740 anikendra 56
	$('.editable').editable({
57
	    touch : true, // Whether or not to support touch (default true)
58
	    lineBreaks : false, // Whether or not to convert \n to <br /> (default true)
59
	    toggleFontSize : false, // Whether or not it should be possible to change font size (default true),
60
	    closeOnEnter : false, // Whether or not pressing the enter key should close the editor (default false)
61
	    event : 'click', // The event that triggers the editor (default dblclick)
62
	    tinyMCE : false, // Integrate with tinyMCE by settings this option to true or an object containing your tinyMCE configuration
13741 anikendra 63
	    //emptyMessage : '<em>'+$(this).data('placeholder')+'</em>', // HTML that will be added to the editable element in case it gets empty (default false)
13740 anikendra 64
	    callback : function( data ) {
65
	        // Callback that will be called once the editor is blurred
66
	        if( data.content ) {
13743 anikendra 67
	        	$('#loadingModal').modal('show');
13740 anikendra 68
	            var field = data.$el.data('field');
69
	            var params = {};
70
	            params['id'] = data.$el.data('id');
71
	            params[field] = data.content;
72
	            $.post(data.$el.data('url')+data.$el.data('id'),params,function(data){
13743 anikendra 73
						if(data.result.success){
74
							$('#loadingModal').modal('hide');
75
						}
13740 anikendra 76
					},'json'); 
77
	        }
78
	        if( data.fontSize ) {
79
	            // the font size has changed
80
	        }
81
 
82
	        // data.$el gives you a reference to the element that was edited
83
	        // data.$el.effect('blink');
84
	    }
85
	});
86
});
13741 anikendra 87
</script>