- Timestamp:
- Apr 23, 2015 12:00:06 PM (10 years ago)
- Location:
- pro-violet-viettel/sourcecode/application/modules/frontend
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/modules/frontend/controllers/home.php
r884 r906 136 136 137 137 public function test(){ 138 $aryMatch = array(); 139 $phoneNumber = '987133325'; 140 $regex = '/^[1,9][0-9]{8,9}$/'; 141 if (preg_match('/^[1,9]([0-9]{8,9})$/', $phoneNumber, $aryMatch)){ 142 $phoneNumber = "0".$phoneNumber; 143 echo $phoneNumber; 144 }else{ 145 echo "Not match"; 146 } 138 $this->load->model('collaborator/collaborator_model'); 139 $province = ' Hà nội'; 140 //$str = trim(ucwords($str)); 141 $district = 'Quận Hai bà trưng'; 142 $str = $this->collaborator_model->getProvinceAndDistict($province, $district); 143 var_dump($str); 144 //echo "Result: ".$str; 147 145 } 148 146 } -
pro-violet-viettel/sourcecode/application/modules/frontend/controllers/lecture.php
r884 r906 53 53 } 54 54 55 if ( $u['province'] == ''&& $u['p_id'] != ''){55 if ((!$u['province'] || !$u['district']) && $u['p_id'] != ''){ 56 56 $update_user_info=1; 57 57 } -
pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php
r884 r906 286 286 if (strlen($input['province']) == 0) { 287 287 $result['errors'][] = array("content"=>lang('_SBG_PROVINCE_REQUIRED_MSG'),"field"=>"province"); 288 } 289 if (strlen($input['district']) == 0) { 290 $result['errors'][] = array("content"=>lang('_SBG_DISTRICT_REQUIRED_MSG'),"field"=>"district"); 288 291 } 289 292 $input['password'] = ''; -
pro-violet-viettel/sourcecode/application/modules/frontend/models/user_model.php
r883 r906 100 100 $this->db->insert ( 'tbluser', $user ); 101 101 //write_file('./log/test.log', date("H:i:s m-d-Y").": ". var_export($user, TRUE)."\n" , FOPEN_WRITE_CREATE); 102 $aryPatterns = array ('/:trialdays:/', '/:username:/', '/:password:/'); 102 //$aryPatterns = array ('/:trialdays:/', '/:username:/', '/:password:/'); 103 $aryPatterns = array ('/:username:/', '/:password:/'); 103 104 $trialdays = $this->config->item('trial_period'); 104 105 $trialdays = strlen($trialdays) < 2 ? '0'. $trialdays : $trialdays; 105 106 if ($this->isViettel($username)){ 106 $sms = preg_replace($aryPatterns, array($ trialdays. ' ngay', $username, $password), lang('_SBG_MO_USER_VIETTEL_REGISTER_SUCCESS_MSG'));107 $sms = preg_replace($aryPatterns, array($username, $password), lang('_SBG_MO_USER_VIETTEL_REGISTER_SUCCESS_MSG')); 107 108 }else{ 108 $aryPatterns = array ('/:username:/', '/:password:/');109 //$aryPatterns = array ('/:username:/', '/:password:/'); 109 110 $sms = preg_replace($aryPatterns, array($username, $password), lang('_SBG_MO_USER_NOT_VIETTEL_REGISTER_SUCCESS_MSG')); 110 111 } -
pro-violet-viettel/sourcecode/application/modules/frontend/views/lecture_editor.php
r838 r906 93 93 </div> 94 94 <div class="form-group"> 95 <label for="form-field- username" class="col-sm-4 control-label no-padding-right">Quáºn / Huyá»n</label>95 <label for="form-field-district" class="col-sm-4 control-label no-padding-right">Quáºn / Huyá»n</label> 96 96 <div class="col-sm-8"> 97 97 <select name="district" id="form-field-district" class="input-large"></select> 98 <label class="block clearfix has-error"> 99 <div id="district" class="help-block error"></div> 100 </label> 98 101 </div> 102 99 103 </div> 100 104 -
pro-violet-viettel/sourcecode/application/modules/frontend/views/user_infor.php
r883 r906 26 26 <label for="form-field-username" class="col-sm-4 control-label no-padding-right">Tá»nh / Thà nh phá»</label> 27 27 <div class="col-sm-8"> 28 <select name="province" id="form-field-province" class="form-field-province col-xs-12 col-sm-10"> 28 <select name="province" id="form-field-province" class="form-field-province-user col-xs-12 col-sm-10"> 29 <option></option> 29 30 <?php foreach ($provinces as $key => $pro): ?> 30 31 <option value="<?php echo $key; ?>" <?php if ($user['province'] == $key) echo "selected"; ?>><?php echo $pro; ?></option> … … 38 39 <label for="form-field-username" class="col-sm-4 control-label no-padding-right">Quáºn / Huyá»n</label> 39 40 <div class="col-sm-8"> 40 <select name="district" id="form-field-district" class="form-field-district col-xs-12 col-sm-10">41 <select name="district" id="form-field-district" class="form-field-district-user col-xs-12 col-sm-10"> 41 42 42 43 </select> … … 60 61 var district_id = "<?php echo $user['district']; ?>"; 61 62 var province_id = "<?php echo $user['province']; ?>"; 63 62 64 $(document).ready(function(){ 63 $(".form-field-province ").change(function(){65 $(".form-field-province-user").change(function(){ 64 66 changeEventProvince(province_id); 65 67 }); 66 if ($(".form-field-province ").val() !== 'undefined'){68 if ($(".form-field-province-user").val() !== 'undefined'){ 67 69 checkSelectedDistrict(province_id); 68 70 } 69 71 }); 72 73 function changeEventProvince(provinceId){ 74 $(".form-field-district-user").html(""); 75 $.ajax({ 76 url: '/frontend/user/getDistrict/' + provinceId, 77 type: 'POST', 78 success: function (data, textStatus, jqXHR) 79 { 80 result = jQuery.parseJSON(data); 81 content = "<option></option>"; 82 if (result != null){ 83 for (var i in result){ 84 content = content + '<option value="' + result[i].district_id + '">'+ result[i].type + " " + result[i].district_name + '</option>' 85 } 86 } 87 $(".form-field-district-user").html(content); 88 } 89 }); 90 } 91 92 function checkSelectedDistrict(provinceId){ 93 $.ajax({ 94 url: '/frontend/user/getDistrict/' + provinceId, 95 type: 'POST', 96 success: function (data, textStatus, jqXHR) 97 { 98 result = jQuery.parseJSON(data); 99 content = "<option></option>"; 100 if (result != null){ 101 for (var i in result){ 102 if (result[i].district_id === district_id){ 103 content = content + '<option value="' + result[i].district_id + '" selected >' + result[i].type + " " + result[i].district_name + '</option>'; 104 }else{ 105 content = content + '<option value="' + result[i].district_id + '">' + result[i].type + " " + result[i].district_name + '</option>'; 106 } 107 } 108 109 } 110 $(".form-field-district-user").html(content); 111 } 112 }); 113 } 70 114 </script> -
pro-violet-viettel/sourcecode/application/modules/frontend/views/user_profile.php
r838 r906 302 302 <div class="alert alert-block alert-success"> 303 303 <p> 304 QuÜ vá» cÅ©ng có thá» sá» dụng sá» Äiá»n thoại <strong><?php echo $username;?></strong> và soạn tin theo cú pháp: <strong>SBG VIP 1</strong> (hay VIP 3 , VIP 6, VIP 12) <strong>gá»i tá»i 8062</strong> (Há» thá»ng sẜ trừ tiá»n trên tà i khoản chÃnh cá»§a sá» Äiá»n thoại <strong><?php echo $username;?></strong>)304 QuÜ vá» cÅ©ng có thá» sá» dụng sá» Äiá»n thoại <strong><?php echo $username;?></strong> và soạn tin theo cú pháp: <strong>SBG VIP 1</strong> (hay VIP 3) <strong>gá»i tá»i 8062</strong> (Há» thá»ng sẜ trừ tiá»n trên tà i khoản chÃnh cá»§a sá» Äiá»n thoại <strong><?php echo $username;?></strong>) 305 305 </p> 306 306 </div>
Note: See TracChangeset
for help on using the changeset viewer.