Skip to content

Commit 7c6fdc3

Browse files
committed
Merge branch 'master' of https://github.com/karsanrichard/HCMPv2
2 parents b9ec228 + aca0cfa commit 7c6fdc3

File tree

20 files changed

+175
-39
lines changed

20 files changed

+175
-39
lines changed

application/config/database.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
$db['default']['hostname'] = 'localhost';
5151
$db['default']['username'] = 'root';
5252
$db['default']['password'] = '';
53-
$db['default']['database'] = 'hcmp_rtk';
53+
$db['default']['database'] = 'hcmp';
5454
$db['default']['dbdriver'] = 'mysql';
5555
$db['default']['dbprefix'] = '';
5656
$db['default']['pconnect'] = TRUE;

application/controllers/orders.php

100755100644
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ public function facility_new_order() {
306306
$user_action = "order";
307307

308308
Log::log_user_action($user, $user_action);
309+
309310
$this -> hcmp_functions -> send_order_sms();
310311

311312
$this -> session -> set_flashdata('system_success_message', "Facility Order No $new_order_no has Been Saved");

application/controllers/reports.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,6 @@ public function expiries($facility_code=null) {
545545

546546
}
547547

548-
549548
public function store_expiries() {
550549
$district_id=isset($district_id) ? $district_id: $this -> session -> userdata('district_id');
551550
$district_name=Districts::get_district_name($district_id)->toArray();

application/controllers/rtk_management.php

100755100644
File mode changed.

application/controllers/user.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -708,9 +708,12 @@ public function edit_user(){
708708
$username_edit = $_POST['username_edit'];
709709
$user_type_edit_district = $_POST['user_type_edit_district'];
710710
$district_name_edit = $_POST['district_name_edit'];
711-
711+
$email_recieve_edit = $_POST['email_edit_recieve'];
712+
$sms_recieve_edit = $_POST['sms_edit_recieve'];
713+
712714
$user_id= $_POST['user_id'];
713-
715+
// echo $email_recieve_edit;exit;
716+
714717
if ($status=="true") {
715718

716719
$status=1;
@@ -732,7 +735,7 @@ public function edit_user(){
732735
//update user
733736
$update_user = Doctrine_Manager::getInstance()->getCurrentConnection();
734737
$update_user->execute("UPDATE `user` SET fname ='$fname' ,lname ='$lname',email ='$email_edit',usertype_id =$user_type_edit_district,telephone ='$telephone_edit',
735-
district ='$district_name_edit',facility ='$facility_id_edit',status ='$status',county_id ='$county'
738+
district ='$district_name_edit',facility ='$facility_id_edit',status ='$status',county_id ='$county',email_recieve ='$email_recieve_edit',sms_recieve ='$sms_recieve_edit'
736739
WHERE `id`= '$user_id'");
737740

738741
}

application/models/commodities.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ public static function get_details($commodity_id) {
5151
return $commodities;
5252
}
5353

54-
5554
public static function get_commodity_name($commodity_id) {
5655
$query =$inserttransaction = Doctrine_Manager::getInstance()->getCurrentConnection()
5756
->fetchAll( "select commodity_name from commodities where status=1 and id=$commodity_id");

application/models/users.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@ public static function get_user_list_all() {
202202
a.id as level_id,
203203
f.level,
204204
a.level,
205-
u.status
205+
u.status,
206+
u.email_recieve,
207+
u.sms_recieve
206208
FROM
207209
user u
208210
LEFT JOIN

application/views/Admin/commodities_v.php

100755100644
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@
2727
<button type="button" class="order-for-excel btn btn-primary" id="order-for-excel">
2828
<span class="glyphicon glyphicon-floppy-open"></span>Upload File</button>
2929
</div>
30+
<<<<<<< HEAD
31+
=======
3032

33+
>>>>>>> 009c71465194e3d5f5df5d1d9e1da5d569082273
3134
</div>
3235

3336
</div>

application/views/Admin/user_listing_v.php

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
<?php //echo "<pre>";print_r($listing);echo "</pre>";exit; ?>
22
<div class="container">
33

44
<?php $x = array();
@@ -78,6 +78,8 @@
7878
<th>Sub-County</th>
7979
<th>Health Facility</th>
8080
<th>User Type</th>
81+
<th>Recieve Email</th>
82+
<th>Recieve Text Msg</th>
8183
<th>Status</th>
8284
<th>Action</th>
8385

@@ -98,6 +100,31 @@
98100
<td class="district" data-attr="<?php echo $list['district_id']; ?>"><?php echo $list['district']; ?></td>
99101
<td class="facility_name" data-attr="<?php echo $list['facility_code']; ?>"><?php echo $list['facility_name']; ?></td>
100102
<td class="level" data-attr="<?php echo $list['level_id']; ?>"><?php echo $list['level']; ?></td>
103+
<?php
104+
//for text and email receivals
105+
//<td style="display:none;" class="email_recieve"><'.$list['email_recieve'];'</td>
106+
//<td style="display:none;" class="sms_recieve"><'.$list['sms_recieve'];'</td>
107+
if ($list['email_recieve']==2):
108+
echo'
109+
<td><input class="email_recieve" data-attr="'.$list['email_recieve'].'" value="'.$list['email_recieve'].'" type="checkbox" disabled checked ="checked"></td>
110+
';
111+
else:
112+
echo'
113+
<td><input class="email_recieve" data-attr="'.$list['email_recieve'].'" value="'.$list['email_recieve'].'" type="checkbox" disabled></td>
114+
';
115+
endif;
116+
117+
if ($list['sms_recieve']==2):
118+
echo'
119+
<td ><input class="sms_recieve" data-attr="'.$list['sms_recieve'].'" value="'.$list['sms_recieve'].'" type="checkbox" disabled checked ="checked"></td>
120+
';
121+
else:
122+
echo'
123+
<td><input class="sms_recieve" data-attr="'.$list['sms_recieve'].'" value="'.$list['sms_recieve'].'" type="checkbox" disabled></td>
124+
';
125+
endif;
126+
?>
127+
101128
<td >
102129
<?php
103130
if ($list['status']==1) {
@@ -348,7 +375,24 @@
348375
<div class=" col-md-6">
349376
<label> User Name </label>
350377
<div class="form-group">
351-
<input type="email" name="username_edit" id="username_edit" required="required" class="form-control " placeholder="[email protected]" tabindex="5" readonly>
378+
<input type="email" name="username_edit" id="username_edit" required="required" class="form-control " placeholder="[email protected]" tabindex="6" readonly>
379+
</div>
380+
</div>
381+
382+
<div class=" col-md-6">
383+
<label> Enable Email Recieval </label>
384+
<div class="form-group">
385+
Yes <input type="radio" data-attr = "2" name="email_recieve_edit_yes" id="email_recieve_edit_yes" required="required" readonly>
386+
No <input type="radio" data-attr = "1" name="email_recieve_edit_no" id="email_recieve_edit_no" required="required" readonly>
387+
<input type="hidden" name="email_recieve_selection" id="email_recieve_selection" class="email_recieve_selection">
388+
</div>
389+
</div>
390+
<div class=" col-md-6">
391+
<label> Enable Text Recieval </label>
392+
<div class="form-group">
393+
Yes <input type="radio" data-attr = "2" name="sms_recieve_edit_yes" id="sms_recieve_edit_yes" required="required" readonly>
394+
No <input type="radio" data-attr = "1" name="sms_recieve_edit_no" id="sms_recieve_edit_no" required="required" readonly>
395+
<input type="hidden" name="sms_recieve_selection" id="sms_recieve_selection" class="sms_recieve_selection">
352396
</div>
353397
</div>
354398
<div class="col-md-6">

application/views/Admin/users_v.php

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
$(document).ready(function () {
6060
$("#create_new,#edit_user").attr("disabled", "disabled");
6161
$('#main-content').on('hidden.bs.modal','#myModal', function () {
62-
alert('jack');
62+
6363
$("#datatable").hide().fadeIn('fast');
6464
// location.reload();
6565
});
@@ -185,13 +185,13 @@
185185
$('.err').html(data.msg);
186186
console.log(data.msg)
187187
$( '.err' ).addClass( "alert-danger alert-dismissable" );
188-
$(".edit_user,#create_new").attr("disabled", "disabled");
188+
$("#edit_user,#create_new").attr("disabled", "disabled");
189189
}else if(data.response=='true'){
190190
console.log(data.msg)
191191
$(".err").empty();
192192
$(".err").removeClass("alert-danger alert-dismissable");
193193
$( '.err' ).addClass( "alert-success alert-dismissable" );
194-
$(".edit_user,#create_new").attr("disabled", false);
194+
$("#edit_user,#create_new").attr("disabled", false);
195195
$('.err').html(data.msg);
196196

197197

@@ -217,13 +217,14 @@
217217

218218
$('.err').html(data.msg);
219219
$( '.err' ).addClass( "alert-danger alert-dismissable" );
220-
$(".edit_user,#create_new").attr("disabled", "disabled");
220+
$("#edit_user,#create_new").attr("disabled", "disabled");
221221
}else if(data.response=='true'){
222-
222+
//var alt = $('#email_recieve').val();
223+
//alert(alt);
223224
$(".err").empty();
224225
$(".err").removeClass("alert-danger alert-dismissable");
225226
$( '.err' ).addClass( "alert-success alert-dismissable" );
226-
$(".edit_user,#create_new").attr("disabled", false);
227+
$("#edit_user,#create_new").attr("disabled", false);
227228
$('.err').html(data.msg);
228229

229230

@@ -280,8 +281,6 @@
280281

281282
function ajax_post_process (url,div){
282283
var url =url;
283-
284-
//alert(url);
285284
// return;
286285
var loading_icon="<?php echo base_url().'assets/img/Preloader_4.gif' ?>";
287286
$.ajax({
@@ -290,7 +289,9 @@ function ajax_post_process (url,div){
290289
'telephone': $('#telephone').val(),'email': $('#email').val(),
291290
'username': $('#username').val(),'facility_id': $('#facility_name').val(),
292291
'county':$('#county').val(),
293-
'district_name': $('#sub_county').val(),'user_type': $('#user_type').val()},
292+
'district_name': $('#sub_county').val(),'user_type': $('#user_type').val()
293+
294+
},
294295
url: url,
295296
beforeSend: function() {
296297

@@ -358,22 +359,36 @@ function ajax_post_process (url,div){
358359
var usertype = $(this).closest('tr').find('.level').attr('data-attr');
359360
var district_id = $(this).closest('tr').find('.district').attr('data-attr');
360361
var facility_id = $(this).closest('tr').find('.facility_name').attr('data-attr');
361-
362+
var email_recieve = $(this).closest('tr').find('.email_recieve').attr('data-attr');
363+
var sms_recieve = $(this).closest('tr').find('.sms_recieve').attr('data-attr');
362364
//fill inputs with relevant data
363365
$('#email_edit').val(email)
364366
$('#email_edit').attr('data-id',$(this).closest('tr').find('.email').attr('data-attr'))
365367
$('#telephone_edit').val(phone)
366368
$('#fname_edit').val(fname)
367369
$('#lname_edit').val(lname)
368370
$('#username_edit').val(email)
369-
370371
$('#user_type_edit_district').val(usertype)
371372
$('#county_edit').val(county)
372373
$('#edit_district').val(district_id)
373374
$('#edit_facility').val(facility_id)
374-
375-
376-
375+
//seth
376+
if (email_recieve=2) {
377+
// alert(email_recieve);return;
378+
// $('#email_recieve_edit_yes').attr('checked', 'checked');
379+
$('#email_recieve_selection').val(email_recieve);
380+
}else if (email_recieve=1) {
381+
$('#email_recieve_edit_no').attr('checked', false);
382+
$('#email_recieve_selection').val(email_recieve);
383+
};
384+
385+
if (sms_recieve=2) {
386+
// $('#sms_recieve_edit_yes').attr('checked', 'checked');
387+
$('#sms_recieve_selection').val(sms_recieve);
388+
}else if (sms_recieve=1) {
389+
$('#sms_recieve_edit_no').attr('checked', false);
390+
$('#sms_recieve_selection').val(sms_recieve);
391+
};
377392

378393

379394
if($(this).closest('tr').find('.status_item').attr('data-attr')=="false"){
@@ -407,11 +422,13 @@ function ajax_post_process (url,div){
407422

408423
$('.err_edit').html(data.msg);
409424
$( '.err_edit' ).addClass( "alert-danger alert-dismissable" );
425+
$("#edit_user,#create_new").attr("disabled", "disabled");
410426
}else if(data.response=='true'){
411427

412428
$(".err_edit").empty();
413429
$(".err_edit").removeClass("alert-danger alert-dismissable");
414430
$( '.err_edit' ).addClass( "alert-success alert-dismissable" );
431+
$("#edit_user,#create_new").attr("disabled", false);
415432
$('.err_edit').html(data.msg);
416433

417434

@@ -448,11 +465,12 @@ function ajax_post_process (url,div){
448465

449466
$('.err').html(data.msg);
450467
$( '.err' ).addClass( "alert-danger alert-dismissable" );
468+
$("#edit_user,#create_new").attr("disabled", "disabled");
451469
}else if(data.response=='true'){
452-
453470
$(".err").empty();
454471
$(".err").removeClass("alert-danger alert-dismissable");
455472
$( '.err' ).addClass( "alert-success alert-dismissable" );
473+
$("#edit_user,#create_new").attr("disabled", false);
456474
$('.err').html(data.msg);
457475

458476

@@ -480,17 +498,15 @@ function ajax_post_process (url,div){
480498

481499
function ajax_post (url,div){
482500
var url =url;
483-
484-
//alert(url);
485-
// return;
486501
var loading_icon="<?php echo base_url().'assets/img/Preloader_4.gif' ?>";
487502
$.ajax({
488503
type: "POST",
489504
data:{ 'fname_edit': $('#fname_edit').val(),'lname_edit': $('#lname_edit').val(),'county_edit': $('#county_edit').val(),
490505
'telephone_edit': $('#telephone_edit').val(),'email_edit': $('#email_edit').val(),
491506
'username_edit': $('#username_edit').val(),'facility_id_edit_district': $('#edit_facility').val(),
492507
'user_type_edit_district': $('#user_type_edit_district').val(),'district_name_edit': $('#edit_district').val(),
493-
'facility_id_edit': $('#edit_facility').val(),'status': $('.onoffswitch-checkbox').prop('checked'),'user_id':$('#email_edit').attr('data-id')},
508+
'facility_id_edit': $('#edit_facility').val(),'status': $('.onoffswitch-checkbox').prop('checked'),'user_id':$('#email_edit').attr('data-id'),
509+
'email_edit_recieve':$('#email_recieve_selection').val(),'sms_edit_recieve':$('#sms_recieve_selection').val()},
494510
url: url,
495511
beforeSend: function() {
496512
//$(div).html("");

0 commit comments

Comments
 (0)