Skip to content

Commit dacc9d4

Browse files
committed
modify table add,edit,delete operation
1 parent 72c2303 commit dacc9d4

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

application/models/users_model.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function update_member($id)
102102
);
103103
$username=$this->input->post('username');
104104
$this->db->where('id', $id);
105-
$this->db->update('member', $member_update_data);
105+
$this->db->update('member', $member_update_data);
106106
if($this->input->post('username')==$this->session->userdata('user_name'))
107107
{
108108
$data = array(

application/views/manage/addgroup.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
if(isset($flash_message)){
33
if($flash_message == TRUE)
44
{
5-
echo '<div class="alert alert-success">';
5+
echo '<div class="alert alert-success rmonitor">';
66
echo '<a class="close" data-dismiss="alert">×</a>';
77
echo '<strong>Well done!</strong> group info add with success.';
88
echo '</div>';
@@ -20,7 +20,7 @@
2020

2121
<div id="sensors" class='boxit'>
2222

23-
<form action="<?php echo site_url("manage/addgroup")?>" method="post" class="form-horizontal">
23+
<form action="<?php echo site_url("manage/addgroup")?>" method="post" class="form-horizontal">
2424
<fieldset>
2525
<div class="control-group">
2626
<label for="inputError" class="control-label">group name</label>
@@ -36,6 +36,6 @@
3636
</div>
3737
</fieldset>
3838

39-
</form>
39+
</form>
4040

4141
</div>

application/views/manage/edituser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
if(isset($flash_message)){
66
if($flash_message == TRUE)
77
{
8-
echo '<div class="alert alert-success">';
8+
echo '<div class="alert alert-success rmonitor">';
99
echo '<a class="close" data-dismiss="alert">×</a>';
1010
echo '<strong>Well done!</strong> user info edit with success.';
1111
echo '</div>';

application/views/table_records.php

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,13 @@ function truntable()
6464
if (status=="success")
6565
{
6666
$('#truntable').text("Truncate");
67-
$('#truntable').attr('disabled',false);
68-
alert(response);
67+
$('#truntable').attr('disabled',false);
6968
closemodal("trun");
70-
location.reload();
69+
$('#resultdiv').show();
70+
$('#resultinfo').html('truncate table <?php echo $tablename?> success!');
71+
var grid = $("#grid").data("kendoGrid");
72+
grid.dataSource.read();
73+
grid.refresh();
7174
}
7275

7376
})
@@ -91,7 +94,7 @@ function deltable()
9194
$('#truntable').attr('disabled',false);
9295
alert('delete table success');
9396
closemodal("deltab");
94-
window.location= ('<?php echo $this->config->base_url();?>index.php');
97+
window.location= ('<?php echo $this->config->base_url();?>');
9598
}
9699
})
97100

@@ -103,6 +106,11 @@ function closemodal(divid)
103106

104107
</script>
105108

109+
<div id="resultdiv" class="alert alert-success hide">
110+
<button type="button" class="close" data-dismiss="alert">&times;</button>
111+
<div id="resultinfo"></div>
112+
</div>
113+
106114
<div>
107115
<h2><?php echo $tablename?></h2>
108116
</div>
@@ -311,10 +319,8 @@ function categoryDropDownEditor(container, options) {
311319
};
312320
function onRequestEnd(e) {
313321
if(e.type=="update" || e.type=="create")
314-
{
315-
alert(e.response[0].result);
316-
location.reload();
317-
322+
{
323+
$("#grid").data("kendoGrid").dataSource.read();
318324
}
319325
};
320326

0 commit comments

Comments
 (0)