Changeset 632
- Timestamp:
- Dec 2, 2014 11:35:56 AM (10 years ago)
- Location:
- pro-violet-viettel/sourcecode/application
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/helpers/lockfile_helper.php
r622 r632 82 82 83 83 $diff = date_diff($datetime1, $datetime2); 84 //$diff = DateTime::diff($datetime1, $datetime2); 84 85 $total = 0; 85 86 switch( $differenceFormat){ … … 109 110 } 110 111 } 112 113 if(!function_exists('date_diff')) { 114 class DateInterval { 115 public $y; 116 public $m; 117 public $d; 118 public $h; 119 public $i; 120 public $s; 121 public $invert; 122 public $days; 123 124 public function format($format) { 125 $format = str_replace('%R%y', 126 ($this->invert ? '-' : '+') . $this->y, $format); 127 $format = str_replace('%R%m', 128 ($this->invert ? '-' : '+') . $this->m, $format); 129 $format = str_replace('%R%d', 130 ($this->invert ? '-' : '+') . $this->d, $format); 131 $format = str_replace('%R%h', 132 ($this->invert ? '-' : '+') . $this->h, $format); 133 $format = str_replace('%R%i', 134 ($this->invert ? '-' : '+') . $this->i, $format); 135 $format = str_replace('%R%s', 136 ($this->invert ? '-' : '+') . $this->s, $format); 137 138 $format = str_replace('%y', $this->y, $format); 139 $format = str_replace('%m', $this->m, $format); 140 $format = str_replace('%d', $this->d, $format); 141 $format = str_replace('%h', $this->h, $format); 142 $format = str_replace('%i', $this->i, $format); 143 $format = str_replace('%s', $this->s, $format); 144 145 return $format; 146 } 147 } 148 149 function date_diff(DateTime $date1, DateTime $date2) { 150 151 $diff = new DateInterval(); 152 153 if($date1 > $date2) { 154 $tmp = $date1; 155 $date1 = $date2; 156 $date2 = $tmp; 157 $diff->invert = 1; 158 } else { 159 $diff->invert = 0; 160 } 161 162 $diff->y = ((int) $date2->format('Y')) - ((int) $date1->format('Y')); 163 $diff->m = ((int) $date2->format('n')) - ((int) $date1->format('n')); 164 if($diff->m < 0) { 165 $diff->y -= 1; 166 $diff->m = $diff->m + 12; 167 } 168 $diff->d = ((int) $date2->format('j')) - ((int) $date1->format('j')); 169 if($diff->d < 0) { 170 $diff->m -= 1; 171 $diff->d = $diff->d + ((int) $date1->format('t')); 172 } 173 $diff->h = ((int) $date2->format('G')) - ((int) $date1->format('G')); 174 if($diff->h < 0) { 175 $diff->d -= 1; 176 $diff->h = $diff->h + 24; 177 } 178 $diff->i = ((int) $date2->format('i')) - ((int) $date1->format('i')); 179 if($diff->i < 0) { 180 $diff->h -= 1; 181 $diff->i = $diff->i + 60; 182 } 183 $diff->s = ((int) $date2->format('s')) - ((int) $date1->format('s')); 184 if($diff->s < 0) { 185 $diff->i -= 1; 186 $diff->s = $diff->s + 60; 187 } 188 189 $start_ts = $date1->format('U'); 190 $end_ts = $date2->format('U'); 191 $days = $end_ts - $start_ts; 192 $diff->days = round($days / 86400); 193 194 if (($diff->h > 0 || $diff->i > 0 || $diff->s > 0)) 195 $diff->days += ((bool) $diff->invert) 196 ? 1 197 : -1; 198 199 return $diff; 200 201 } 202 203 } -
pro-violet-viettel/sourcecode/application/modules/frontend/views/lecture_editor.php
r631 r632 12 12 <?php $flashVars.= '&youtubeUrl='.$base_url.'assets/soanbai/Service/fake_youtube.php'.$langParam.'&command=Init OK' ?> 13 13 <?php $flashVars.= '&licenseStatus='.$licenseAvailable ?> 14 <?php $flashVars.= '&userId='. $licflashVars['id']?>15 <?php $flashVars.= '&appUserName='. $licflashVars['fullname']?>16 <?php $flashVars.= '&appAddress='. $licflashVars['school']?>14 <?php $flashVars.= '&userId='. isset($licflashVars['id']) ? $licflashVars['id']:'' ?> 15 <?php $flashVars.= '&appUserName='.isset($licflashVars['fullname']) ? $licflashVars['fullname']:'' ?> 16 <?php $flashVars.= '&appAddress='.isset($licflashVars['school']) ? $licflashVars['school']:'' ?> 17 17 18 18 <div class="embed-responsive embed-responsive-4by3"> -
pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php
r629 r632 268 268 269 269 $aryTopupResult = $result[$keys[0]]; 270 270 271 $debugMsg = 'Logged time: '. date('Y-m-d H:i:s') ."\n"; 272 $debugMsg .= 'Send:'."\n" .$xml ."\n\n"; 273 $debugMsg .= 'Result:'."\n". var_export($result, TRUE); 274 write_file('./log/topup_log', $debugMsg); 275 271 276 if ($aryTopupResult['Success'] == 'false') { 272 277 return _SBG_CARD_PAY_FAIL;
Note: See TracChangeset
for help on using the changeset viewer.