Permalink
Browse files

added some comments and clean up the code

  • Loading branch information...
1 parent 2a8ca44 commit c5efa9d6ed5c1e0ab78265cf85e067c85f15c74f @t1gr0u committed Mar 1, 2013
Showing with 12 additions and 14 deletions.
  1. +12 −14 controllers/twilio.php
View
26 controllers/twilio.php
@@ -12,23 +12,21 @@ class Twilio extends CI_Controller {
function __construct() {
try {
-
- $this->load->library( 'twilio_services' );
- $thisMonth = date( 'Y-m-d', mktime( 3, 0, 0, date( 'm' ), 1, date( 'Y' ) ) );
-
- foreach ( $this->twilio_services->account->calls->getIterator( 0, 50, array(
- "Status" => "completed",
- "StartTime>" => $thisMonth
- ) ) as $call
- ) {
- print ' $call->direction: ' . $call->direction . ' date_created:' . $call->date_created . ' $call->from: ' . $call->from . ' $call->to: ' . $call->to . '<br/>';
- }
-
-
+ // load the library
+ $this->load->library( 'twilio_services' );
+ $thisMonth = date( 'Y-m-d', mktime( 3, 0, 0, date( 'm' ), 1, date( 'Y' ) ) );
+
+ // get all the call from the 1st of the month
+ foreach ( $this->twilio_services->account->calls->getIterator( 0, 50, array(
+ "Status" => "completed",
+ "StartTime>" => $thisMonth
+ ) ) as $call
+ ) {
+ print ' $call->direction: ' . $call->direction . ' date_created:' . $call->date_created . ' $call->from: ' . $call->from . ' $call->to: ' . $call->to . '<br/>';
+ }
} catch( Exception $e ) {
print $e->getMessage();
}
-
}
}

0 comments on commit c5efa9d

Please sign in to comment.