Subversion Repositories SmartDukaan

Rev

Rev 22792 | Rev 22794 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
22793 amit.gupta 1
<style>
2
.modal-dialog {
3
  width: 100%;
4
  height: auto;
5
  margin: 0;
6
  padding: 0;
7
}
8
 
9
.modal-content {
10
  height: auto;
11
  min-height: 100%;
12
  border-radius: 0;
13
}
14
</style>
22783 amit.gupta 15
<div class="container" id="vueFirst">
22761 amit.gupta 16
 
17
	<?php if(isset($result) && !empty($result)):?>
18
		<div class="row">
22783 amit.gupta 19
			<div class="col-xs-12">
22761 amit.gupta 20
				<table cellpadding="0" cellspacing="0" class="table table-striped">
21
					<tr>
22
						<th>Name</th>
23
						<th>Email</th>
24
						<th>Mobile</th>
25
						<th>Business Name</th>
26
						<th>Type</th>
27
						<th>Number</th>
28
						<th>Created</th>
29
						<th>Actions</th>
30
					</tr>
31
 
32
					<?php foreach ($result as $rkey =>$rval):?>
33
					<tr>
22777 amit.gupta 34
						<td><?php echo $rval['u']['first_name'].' '.$rval['u']['last_name'];?></td>
22761 amit.gupta 35
						<td><?php echo $rval['u']['email'];?></td>
36
						<td><?php echo $rval['u']['mobile_number'];?></td>
22779 amit.gupta 37
						<td><?php echo $rval['a']['name'];?></td>
22761 amit.gupta 38
						<td><?php echo $rval['r']['type'];?></td>
39
						<td><?php echo $rval['r']['number'];?></td>
22780 amit.gupta 40
						<td><?php echo $rval['r']['create_timestamp'];?></td>
22788 amit.gupta 41
						<td><button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#myModal" v-on:click="setIndex(<?php echo $rkey?>)">View Details</button> 
22761 amit.gupta 42
					</tr>
43
					<?php endforeach;?>
44
 
45
				</table>
46
			</div>
47
		</div>
48
	<?php endif;?>
22766 amit.gupta 49
	<!-- Modal -->
50
	<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
51
	  <div class="modal-dialog" role="document">
52
	    <div class="modal-content">
53
	      <div class="modal-header">
54
	        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
22789 amit.gupta 55
	        <h4 class="modal-title" id="myModalLabel">{{chosenData.a.name}}</h4>
22766 amit.gupta 56
	      </div>
57
	      <div class="modal-body">
22792 amit.gupta 58
	        <input v-model="chosenData.r.number" >
59
	        <input v-model="chosenData.a.line_1">
60
	        <input v-model="chosenData.a.line_2">
61
	        <input v-model="chosenData.a.city">
62
	        <input v-model="chosenData.a.state">
63
	        <input v-model="chosenData.a.pin">
22766 amit.gupta 64
	      </div>
65
	      <div class="modal-footer">
22767 amit.gupta 66
	        <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">Close</button>
67
	        <button type="button" class="btn btn-sm btn-primary">Save changes</button>
22766 amit.gupta 68
	      </div>
69
	    </div>
70
	  </div>
71
	</div>
22787 amit.gupta 72
</div>
73
<script src="https://unpkg.com/vue"></script>
74
<script type="text/javascript">
75
	var alldata = <?php echo json_encode($result);?>;
76
	var vModal = new Vue({
77
	el: '#vueFirst',
78
	data: {
22788 amit.gupta 79
		chosenData : alldata[0]
22787 amit.gupta 80
  	},
81
  	methods: {
82
  		setIndex: function(index){
22791 amit.gupta 83
  			//console.log("called " + index); 
84
  			this.chosenData = alldata[index];
22787 amit.gupta 85
  		}
86
  	}
87
}) 
88
</script>