示例#1
0
 /**
  * Constructor.
  *
  * @param string $key Key string
  */
 public function __construct($key = null)
 {
     $this->cipherMethod = 'aes-128-cbc';
     $this->keySize = 16;
     $this->type = self::AES128_CBC;
     parent::__construct($key);
 }
示例#2
0
文件: Mixin.php 项目: enumag/ivory
 /**
  * @param string
  * @param array
  * @param int
  * @return void
  */
 public function __construct($name, array $args, $line)
 {
     parent::__construct();
     $this->name = $name;
     $this->args = $args;
     $this->line = $line;
 }
示例#3
0
 /**
  * Constructor.
  *
  * @param string $key Key string
  */
 public function __construct($key = null)
 {
     $this->cipherMethod = 'aes-256-cbc';
     $this->keySize = 32;
     $this->type = self::AES256_CBC;
     parent::__construct($key);
 }
示例#4
0
 /**
  * Creates a new Layout
  * @param string $html Sub content
  */
 public function __construct($html = '')
 {
     parent::__construct('layout', $html);
     $this->loadSession();
     $this->addMicrodata();
     $this->loadIdioms();
 }
 function __construct($block_id)
 {
     parent::__construct($block_id);
     global $site_settings;
     //$this->cal['day_names'] = array( 1 => 'Monday', 2 => 'Tuesday', 3 => 'Wednesday', 4 => 'Thursday', 5 => 'Friday', 6 => 'Saturday', 7 => 'Sunday' ); // these names could be set to a different language or used as abbreviated names, etc.
     $this->cal['day_names'] = $site_settings['day_names'];
     $this->cal['week_start'] = 7;
     // from what day of the week to start the week
     $this->cal['wkh'] = array();
     // holds days of the week starting from selected week_start
     $this->cal['wks'] = array();
     // holds matrix for calendar in the form of $this->cal['wks'][index = <YY-MM-01>][j = <week number>][i = <day number placeholder>] = day of month, i.e. 23.
     $this->cal['hours_monthly'] = array();
     // holds total number of scheduled hours for each month in the format of: $this->cal['hours_monthly'][<category>][index = <YY-MM-01>] = hours
     $this->cal['hours_daily'] = array();
     // same as above but has sum of scheduled hours for all members for each day
     //$this->cal['nav_links'] = array(); // holds html code for navigation links around the calendar. Currently <a href="" class="prev/next"></a>. This array is first referenced by 'index' for each calendar month, then contains 'prev' and 'next' links, i.e. $this->cal['nav_links'][$inbox]=>array( 'prev' => <html>, 'next' => <html> )
     $this->cal['start_ts'] = 0;
     // timestamps for the start and end of the calendar array
     $this->cal['end_ts'] = 0;
     $this->cal['members'] = array();
     // holds all members that have events in the given calendar span in the format of: $this->cal['members'][<category>][<group>]['f.l'][<account_no>] = <first_name.last_name>; $this->cal['members'][<category>][<group>]['l.f'][<account_no>] = <last_name.first_name>
     if (isset($_GET['city'])) {
         $this->city = $_GET['city'];
     } else {
         $this->city = $_SESSION['user']['city'];
     }
     /*
      * create calendars and corresponding next and prev nav_links
      */
     $n = 3 + 6;
     // number of months back and forward from the current month
     $year = date('Y');
     $start_mo = date('n') - 3;
     if ($start_mo <= 0) {
         $start_mo += 12;
         $year -= 1;
     }
     for ($month = $start_mo, $i = 0; $i < $n; $month++, $i++) {
         if ($month > 12) {
             $month = $month - 12;
             $year++;
         }
         $index = sprintf('%04s-%02s-01', $year, $month);
         if (0 == $i) {
             $this->cal['start_ts'] = strtotime($index);
             // needed to determine boundaries of event cycles
             $week = 0;
             // keep track of the number of the week within entire calendar sequence stored in $this->cal['wks']. Needed for javascript slide display in weekly view
         }
         $this->create_calendar($month, $year, $week);
         $week += count($this->cal['wks'][$index]);
         $this->cal['end_ts'] = strtotime($index) + date('t', strtotime($index)) * 3600 * 24;
         // date( 't' ) number of days in a given month
         $this->cal['hours_monthly'][$site_settings['cats'][0]][$index] = 0;
         // initialize for iteration of the events table for figuring out number of hours scheduled for the month
         $this->cal['hours_monthly'][$site_settings['cats'][1]][$index] = 0;
         // initialize for iteration of the events table for figuring out number of hours scheduled for the month
     }
 }
示例#6
0
 protected function __construct(Page $parent, $nextPage, $refreshEnabled = false, $dataRequiredFromPage = "")
 {
     parent::__construct($parent);
     $this->nextPage = $nextPage;
     $this->refreshEnabled = $refreshEnabled;
     $this->dataRequiredFromPage = $dataRequiredFromPage;
 }
示例#7
0
 public function __construct($p_settings)
 {
     Assert::type(__METHOD__, 'is_array($p_settings)', is_array($p_settings));
     parent::__construct($p_settings);
     $this->m_blocks = array();
     $this->state = -1;
 }
示例#8
0
 /**
  * Constructor.
  *
  * @param string $key Key string
  */
 public function __construct($key = null)
 {
     $this->cipherMethod = 'des-ede3-cbc';
     $this->keySize = 24;
     $this->type = self::TRIPLEDES_CBC;
     parent::__construct($key);
 }
 function __construct()
 {
     $block_options = array('name' => __('Carousel', 'oblivion'), 'size' => 'span12');
     //create the widget
     parent::__construct('Carousel_Block', $block_options);
     //add ajax functions
     add_action('wp_ajax_block_item_add_new', array($this, 'add_item'));
 }
示例#10
0
 function __construct()
 {
     $block_options = array('name' => __('Tabs &amp; Toggles', 'oblivion'), 'size' => 'span6');
     //create the widget
     parent::__construct('Tabs_Block', $block_options);
     //add ajax functions
     add_action('wp_ajax_block_tab_add_new', array($this, 'add_tab'));
 }
示例#11
0
 public function __construct()
 {
     parent::__construct();
     DB::connect();
     if (isset($_SESSION['userid'])) {
         $this->setUser();
     }
 }
 function __construct()
 {
     $block_options = array('name' => __('Skills', 'oblivion'), 'size' => 'span8');
     //create the widget
     parent::__construct('Skills_Block', $block_options);
     //add ajax functions
     add_action('wp_ajax_block_skill_add_new', array($this, 'add_skill'));
 }
 function __construct($title, $description = NULL, $items = NULL, $help_text = NULL, $hidden = FALSE)
 {
     parent::__construct('sidebar_item');
     if (is_null($items)) {
         $items = array();
     }
     $this->set_vars(compact('title', 'description', 'items', 'help_text'));
     $this->hidden = $hidden;
 }
示例#14
0
 public function __construct($p_model, $p_view, $p_settings)
 {
     Assert::type(__METHOD__, '$p_model instanceof Model || is_null($p_model)', $p_model instanceof Model || is_null($p_model));
     Assert::type(__METHOD__, '$p_view instanceof View || is_null($p_view)', $p_view instanceof View || is_null($p_view));
     parent::__construct($p_settings);
     $this->m_model = $p_model;
     $this->m_view = $p_view;
     $this->outputs = array();
 }
示例#15
0
 public function __construct($texto, $template = null)
 {
     //echo 'construtct Texto';
     $this->templateHolder = $template;
     if ($template != null) {
         parent::__construct($template);
     }
     $this->pTexto = $texto;
 }
示例#16
0
 function __construct($block_id)
 {
     $this->messages = array(0 => '<div class="notif success"><strong>Success :</strong> User information updated. <a href="#" class="close"></a></div>', 1 => '<div class="notif error"><strong>Error :</strong> Could not update user information. Please contact your system administrator. <a href="#" class="close"></a></div>', 2 => '<div class="notif success"><strong>Success :</strong> Schedule information updated. <a href="#" class="close"></a></div>', 3 => '<div class="notif error"><strong>Error :</strong> Could not update schedule information. Please contact your system administrator. <a href="#" class="close"></a></div>', 4 => '<div class="notif info"><strong>Information :</strong> New scheduled shift added. Check days of week, select time and click \'Submit\'.<a href="#" class="close"></a></div>', 5 => '<div class="notif error"><strong>Error :</strong> Could not add new shift information. Please contact your system administrator. <a href="#" class="close"></a></div>', 6 => '<div class="notif error"><strong>Error :</strong> Could not delete existing shift. Please contact your system administrator. <a href="#" class="close"></a></div>', 7 => '<div class="notif success"><strong>Success :</strong> Shift deleted. <a href="#" class="close"></a></div>', 8 => '<div class="notif error"><strong>Error :</strong> Could not add user to the database. Please try again later. <a href="#" class="close"></a></div>', 9 => '<div class="notif success"><strong>Success :</strong> New user added. You can now add work and off time shifts or click Back to go back to the calendar view. <a href="#" class="close"></a></div>', 10 => '<div class="notif error"><strong>Error :</strong> User already exists. <a href="#" class="close"></a></div>', 11 => '<div class="notif error"><strong>Error :</strong> Email address already exists. Please provide unique email address. <a href="#" class="close"></a></div>', 12 => '<div class="notif error"><strong>Error :</strong> You are trying to change existing user\'s name to the one that is already registered. You can use an alias or a middle name to make users unique. <a href="#" class="close"></a></div>', 13 => '<div class="notif success"><strong>Success :</strong> Updated user information and password. <a href="#" class="close"></a></div>');
     parent::__construct($block_id);
     //$this->cache_allowed = FALSE; // This block relies heavily on db for all of its values. Disallow caching of this block (and subsequently entire view) because we want it to be reconstructed every time in order to get its valued filled from db.
     global $errors, $query, $site_settings;
     // $errors holds error messages for the entire site, $this->errors error messages for this block
     $this->errors['update_user_info'] = array('first_name' => '&nbsp;', 'last_name' => '&nbsp;', 'middle_name' => '&nbsp;', 'email_addr' => '&nbsp;', 'password' => '&nbsp;', 'phone_a' => '&nbsp;', 'city' => '&nbsp;', 'duplicate' => '&nbsp;');
     // holds error messages for the form fields
     for ($i = 0; $i <= 59; $i += $site_settings['formats']['min_round']) {
         $this->minutes[] = (int) ceil($i / $site_settings['formats']['min_round']) * $site_settings['formats']['min_round'];
     }
     try {
         if ('user_edit' == $_SESSION['user']['view']) {
             if (isset($_GET['user'])) {
                 //var_dump( $_GET ); exit();
                 /* get user's info and associated content ids*/
                 $query[17]->bindParam(':account_no', $_GET['user'], PDO::PARAM_STR);
                 $query[17]->execute();
                 if (!($this->user = $query[17]->fetch(PDO::FETCH_ASSOC))) {
                     throw new CustomException($errors['24']);
                 }
                 $this->x['user_groups_system'] = json_decode($this->user['user_groups_system']);
                 /* get user's cycles. Users cycles can only be mentioned once per category, i.e. for "work", would be only one line, with all the cycles collected into one json string. In this way, any user may have max 2 lines in the content_a table, one for each category: "work", "offtime" */
                 if ($this->x['content_a_ids'] = json_decode($this->user['content_a_ids'])) {
                     foreach ($this->x['content_a_ids'] as $id) {
                         $query[18]->bindParam(':id', $id, PDO::PARAM_INT);
                         $query[18]->execute();
                         if (!($result[18] = $query[18]->fetch(PDO::FETCH_ASSOC))) {
                             throw new CustomException($errors['26']);
                         }
                         $this->x['content_cats'] = json_decode($result[18]['cont_categories']);
                         $cat = $this->x['content_cats'][0];
                         // work with only the first category mentioned in the json string for cont_categories
                         $this->content[$cat][$id] = json_decode($result[18]['content']);
                     }
                 }
             } elseif ('user_add' == $_GET['action']) {
                 $this->user = array('first_name' => NULL, 'last_name' => NULL, 'middle_name' => NULL, 'alias' => NULL, 'city' => 'phoenix', 'email_addr' => NULL, 'phone_a' => NULL, 'user_groups_system' => '["driver"]', 'content_a_ids' => NULL, 'account_no' => NULL);
                 //echo "got into the user_add branch\n";
                 $this->x['user_groups_system'] = array($_GET['group0']);
                 $this->x['content_a_ids'] = NULL;
             } else {
                 //reset_user();
                 //header( "Location:{$this->form_proc}" );
                 throw new CustomException($errors['24']);
             }
         } else {
             //reset_user();
             //header( "Location:{$this->form_proc}" );
             throw new CustomException(sprintf($errors['12'], $_SESSION['user']['view'], $_SESSION['user']['user_group']));
         }
     } catch (CustomException $e) {
         echo $e;
         exit;
     }
 }
示例#17
0
 function __construct($block_id)
 {
     $this->messages = array(0 => '<div class="notif success"><strong>Success :</strong> User information updated. <a href="#" class="close"></a></div>', 1 => '<div class="notif error"><strong>Error :</strong> Could not update user information. Please contact your system administrator. <a href="#" class="close"></a></div>', 2 => '<div class="notif success"><strong>Success :</strong> Schedule information updated. <a href="#" class="close"></a></div>', 3 => '<div class="notif error"><strong>Error :</strong> Could not update schedule information. Please contact your system administrator. <a href="#" class="close"></a></div>', 4 => '<div class="notif info"><strong>Information :</strong> New scheduled shift added. Check days of week, select time and click \'Submit\'.<a href="#" class="close"></a></div>', 5 => '<div class="notif error"><strong>Error :</strong> Could not add new shift information. Please contact your system administrator. <a href="#" class="close"></a></div>', 6 => '<div class="notif error"><strong>Error :</strong> Could not delete existing shift. Please contact your system administrator. <a href="#" class="close"></a></div>', 7 => '<div class="notif success"><strong>Success :</strong> Shift deleted. <a href="#" class="close"></a></div>', 8 => '<div class="notif error"><strong>Error :</strong> Could not add user to the database. Please try again later. <a href="#" class="close"></a></div>', 9 => '<div class="notif success"><strong>Success :</strong> New user added. You can now add work and off time shifts or click Back to go back to the calendar view. <a href="#" class="close"></a></div>', 10 => '<div class="notif error"><strong>Error :</strong> User already exists. <a href="#" class="close"></a></div>', 11 => '<div class="notif error"><strong>Error :</strong> Email address already exists. Please provide unique email address. <a href="#" class="close"></a></div>', 12 => '<div class="notif error"><strong>Error :</strong> You are trying to change existing user\'s name to the one that is already registered. You can use an alias or a middle name to make users unique. <a href="#" class="close"></a></div>', 13 => '<div class="notif success"><strong>Success :</strong> Updated user information and password. <a href="#" class="close"></a></div>');
     parent::__construct($block_id);
     global $errors, $query, $site_settings;
     // $errors holds error messages for the entire site, $this->errors error messages for this block
     $this->errors['update_user_info'] = array('first_name' => '&nbsp;', 'last_name' => '&nbsp;', 'middle_name' => '&nbsp;', 'email_addr' => '&nbsp;', 'password' => '&nbsp;', 'phone_a' => '&nbsp;', 'city' => '&nbsp;', 'duplicate' => '&nbsp;');
     // holds error messages for the form fields
     for ($i = 0; $i <= 59; $i += $site_settings['formats']['min_round']) {
         $this->minutes[] = (int) ceil($i / $site_settings['formats']['min_round']) * $site_settings['formats']['min_round'];
     }
     try {
         $query[17]->bindParam(':account_no', $_SESSION['user']['account_no'], PDO::PARAM_STR);
         $query[17]->execute();
         if (!($this->user = $query[17]->fetch(PDO::FETCH_ASSOC))) {
             throw new CustomException($errors['24']);
         }
         $this->x['user_groups_system'] = json_decode($this->user['user_groups_system']);
         if ($this->x['content_a_ids'] = json_decode($this->user['content_a_ids'])) {
             foreach ($this->x['content_a_ids'] as $id) {
                 $query[18]->bindParam(':id', $id, PDO::PARAM_INT);
                 $query[18]->execute();
                 if (!($result[18] = $query[18]->fetch(PDO::FETCH_ASSOC))) {
                     throw new CustomException($errors['26']);
                 }
                 $this->x['content_cats'] = json_decode($result[18]['cont_categories']);
                 $cat = $this->x['content_cats'][0];
                 // work with only the first category mentioned in the json string for cont_categories
                 $this->content[$cat][$id] = json_decode($result[18]['content']);
             }
         }
     } catch (CustomException $e) {
         echo $e;
         exit;
     }
 }
 function __construct()
 {
     $block_options = array('name' => __('Page Header', 'oblivion'), 'size' => 'span12', 'title2' => '');
     //create the block
     parent::__construct('page_header_block', $block_options);
 }
示例#19
0
 function __construct($block_id)
 {
     $this->messages = array(0 => '<div class="notif success"><strong>Success :</strong> User deleted. <a href="#" class="close"></a></div>', 1 => '<span>test</span>');
     parent::__construct($block_id);
 }
 function __construct()
 {
     $block_options = array('name' => __('Alerts', 'oblivion'), 'size' => 'span6');
     //create the block
     parent::__construct('alert_block', $block_options);
 }
示例#21
0
 function __construct($block_id)
 {
     parent::__construct($block_id);
     global $site_settings;
     //$this->cal['day_names'] = array( 1 => 'Monday', 2 => 'Tuesday', 3 => 'Wednesday', 4 => 'Thursday', 5 => 'Friday', 6 => 'Saturday', 7 => 'Sunday' ); // these names could be set to a different language or used as abbreviated names, etc.
     $this->cal['day_names'] = $site_settings['day_names'];
     $this->cal['week_start'] = 7;
     // from what day of the week to start the week
     $this->cal['wkh'] = array();
     // holds days of the week starting from selected week_start
     $this->cal['wks'] = array();
     // holds matrix for calendar in the form of $this->cal['wks'][index = <YY-MM-01>][j = <week number>][i = <day number placeholder>] = day of month, i.e. 23.
     $this->cal['hours_monthly'] = array();
     // holds total number of scheduled hours for each month in the format of: $this->cal['hours_monthly'][<category>][index = <YY-MM-01>] = hours
     $this->cal['hours_daily'] = array();
     // same as above but has sum of scheduled hours for all members for each day
     //$this->cal['nav_links'] = array(); // holds html code for navigation links around the calendar. Currently <a href="" class="prev/next"></a>. This array is first referenced by 'index' for each calendar month, then contains 'prev' and 'next' links, i.e. $this->cal['nav_links'][$inbox]=>array( 'prev' => <html>, 'next' => <html> )
     $this->cal['start_ts'] = 0;
     // timestamps for the start and end of the calendar array
     $this->cal['end_ts'] = 0;
     $this->cal['members'] = array();
     // holds all members that have events in the given calendar span in the format of: $this->cal['members'][<category>][<group>]['f.l'][<account_no>] = <first_name.last_name>; $this->cal['members'][<category>][<group>]['l.f'][<account_no>] = <last_name.first_name>
     if (isset($_GET['group'])) {
         $this->group = $_GET['group'];
     } else {
         $this->group = $_SESSION['user']['user_group'];
     }
     if (isset($_GET['city'])) {
         $this->city = $_GET['city'];
     } else {
         $this->city = $_SESSION['user']['city'];
     }
     /*
      * create calendars and corresponding next and prev nav_links
      */
     $n = 3 + 6;
     // number of months back and forward from the current month
     $year = date('Y');
     $start_mo = date('n') - 3;
     if ($start_mo <= 0) {
         $start_mo += 12;
         $year -= 1;
     }
     for ($month = $start_mo, $i = 0; $i < $n; $month++, $i++) {
         if ($month > 12) {
             $month = $month - 12;
             $year++;
         }
         $index = sprintf('%04s-%02s-01', $year, $month);
         if (0 == $i) {
             $this->cal['start_ts'] = strtotime($index);
             // needed to determine boundaries of event cycles
             $week = 0;
             // keep track of the number of the week within entire calendar sequence stored in $this->cal['wks']. Needed for javascript slide display in weekly view
         }
         /*next and prev links */
         // $this->cal['nav_links'][$index] = array( 'prev' => NULL, 'next' => NULL );
         // if ( $i > 0 ) {
         // $this->cal['nav_links'][$prev_index]['next'] = sprintf( '<a href="#%s" class="next"></a>', $index );
         // $this->cal['nav_links'][$index]['prev'] = sprintf( '<a href="#%s" class="prev"></a>', $prev_index );
         // }
         // $prev_index = $index;
         $this->create_calendar($month, $year, $week);
         $week += count($this->cal['wks'][$index]);
         $this->cal['end_ts'] = strtotime($index) + date('t', strtotime($index)) * 3600 * 24;
         // date( 't' ) number of days in a given month
         $this->cal['hours_monthly'][$site_settings['cats'][0]][$index] = 0;
         // initialize for iteration of the events table for figuring out number of hours scheduled for the month
         $this->cal['hours_monthly'][$site_settings['cats'][1]][$index] = 0;
         // initialize for iteration of the events table for figuring out number of hours scheduled for the month
     }
     /*
     * create event tables for each group and fill in members that occur in entire calendar for the group
     * Result of this operation is three arrays:
     * a) $this->events[<category>][<group>][<date>][<account_no>] = array(<event data>)
     * b) $this->cal['members'][<category>][<group>]['f.l'] = array( <account_no1> => '<first_name1>.<last_name1>', <account_no2> => '<first_name2>.<last_name2>', ... ) sorted by first then last name
     * c) $this->cal['members'][<category>][<group>]['l.f'] = array( <account_no1>' => <last_name1>.<first_name1>', <account_no2> => '<last_name2>.<first_name2>', ... ) sorted by last then first name
     * where: <category> = 'work | offtime', see $site_settings['cats']
     				<group> = 'dispatcher | driver | staff | admin', see $site_settings['user_groups']
     				and so on.
     */
     $mask = array(1 => 0b1000000, 2 => 0b100000, 3 => 0b10000, 4 => 0b1000, 5 => 0b100, 6 => 0b10, 7 => 0b1);
     //masks used for bitwise ops on the cyclicity flag of each appointment
     foreach ($site_settings['cats'] as $cat) {
         /* if any group is missing appointment cycle data, fetch it from database. */
         $this->update_event_cycles($this->group, $cat);
         /* Reserve arrays for calendar participants for each category of their events. This avoids missing indicies problem when merging arrays */
         $this->cal['members'][$cat][$this->group]['f.l'] = array();
         $this->cal['members'][$cat][$this->group]['l.f'] = array();
         /* Unpack event cycles into $this->events[<group>] and fill in members that occur into $this->cal['members'][<group>] */
         foreach ($this->cycle[$cat][$this->group] as $l) {
             // pull each fetched content record done by query[11]
             $content = json_decode($l['content'], TRUE);
             // TRUE makes array instead of objects. Schedule content is stored as collection of enumerations.
             foreach ($content as $cycle) {
                 // record is in the format: array( 'YYYY-MM-DDTHH:MM:SS+00:00',<duration>,<cyclicity>,'YYYY-MM-DDTHH:MM:SS+00:00' )
                 $event['cycle_start_ts'] = strtotime($cycle[0]);
                 $event['cycle_end_ts'] = strtotime($cycle[3]);
                 /* check if event cycle falls within our calendar scope */
                 if ($event['cycle_end_ts'] > $this->cal['start_ts'] || $event['cycle_start_ts'] < $this->cal['end_ts']) {
                     /* check if event cycle needs to be cut to match either $this->cal['start_ts'] or $this->cal['end_ts'] plus corresponding weekday and hour offsets */
                     if ($event['cycle_start_ts'] < $this->cal['start_ts']) {
                         $offset['hour'] = date('G', $event['cycle_start_ts']) * 3600;
                         $offset['min'] = date('i', $event['cycle_start_ts']) * 60;
                         $event['cycle_start_ts'] = $this->cal['start_ts'] + array_sum($offset);
                     }
                     if ($event['cycle_end_ts'] > $this->cal['end_ts']) {
                         $event['cycle_end_ts'] = $this->cal['end_ts'];
                     }
                     for ($ts = $event['cycle_start_ts']; $ts <= $event['cycle_end_ts'];) {
                         $dow = date('N', $ts);
                         // get ISO-8601 numeric representation of the day of the week 1(Monday), 7(Sunday)
                         /* Mask for day of the week returns itself if corresponding bits are set in the cycle[2], otherwise 0 */
                         if ($mask[$dow] & $cycle[2]) {
                             // returns $this->mask[$dow] if corresponding bits are set in $cycle[2]
                             $event['start_ts'] = $ts;
                             $date = date('Y-m-d', $ts);
                             $length = $cycle[1] * 60;
                             $event['end_ts'] = $ts + $length;
                             /* It is assumed that no event has length over 24 hours. Split up the event if goes over into nex day */
                             $start_hour = date('G', $event['start_ts']);
                             //'G' 24-hour format of an hour without leading zeros
                             $end_hour = date('G', $event['end_ts']);
                             if ($end_hour < $start_hour) {
                                 $event['end_ts1'] = strtotime(substr_replace(date('c', $event['start_ts']), '23:59:59', 11, 8));
                                 $this->events[$cat][$this->group][$date][$l['account_no']][] = array('start' => $event['start_ts'], 'end' => $event['end_ts1'], 'first_name' => $l['first_name'], 'last_name' => $l['last_name']);
                                 if ($length - ($event['end_ts1'] + 1 - $event['start_ts'])) {
                                     $date = date('Y-m-d', $ts + 24 * 3600);
                                     $event['start_ts1'] = $event['end_ts1'] + 1;
                                     $this->events[$cat][$this->group][$date][$l['account_no']][] = array('start' => $event['start_ts1'], 'end' => $event['end_ts'], 'first_name' => $l['first_name'], 'last_name' => $l['last_name']);
                                 }
                             } else {
                                 $this->events[$cat][$this->group][$date][$l['account_no']][] = array('start' => $event['start_ts'], 'end' => $event['end_ts'], 'first_name' => $l['first_name'], 'last_name' => $l['last_name']);
                             }
                             $this->cal['members'][$cat][$this->group]['f.l'][$l['account_no']] = sprintf('%s.%s', $l['first_name'], $l['last_name']);
                             // 'f.l' is the sort order
                             $this->cal['members'][$cat][$this->group]['l.f'][$l['account_no']] = sprintf('%s.%s', $l['last_name'], $l['first_name']);
                             // 'l.f' is the sort order
                             /* add hours worked for the month */
                             $index = date('Y-m-01', $ts);
                             $this->cal['hours_monthly'][$cat][$index] += ($event['end_ts'] - $event['start_ts']) / 3600;
                             /* increment timestamp: shift to next day, because cyclicity is daily, i.e. by day of the week */
                             $ts = $event['start_ts'] + 24 * 3600;
                         } else {
                             $ts += 24 * 3600;
                         }
                     }
                 }
             }
             // next event cycle record
             /* sort all group members by f.l and l.f names */
             //array_multisort( $this->cal['members'][$cat][$this->group]['f.l'], SORT_ASC, SORT_STRING );
             //array_multisort( $this->cal['members'][$cat][$this->group]['l.f'], SORT_ASC, SORT_STRING );
         }
     }
     // merge members for the 'work' and 'offtime' categories bc work and off times are presented in the same calendar
     //var_dump($this->cal['members']['offtime']); exit();
     $this->cal['members']['all'][$this->group]['f.l'] = array_merge($this->cal['members']['work'][$this->group]['f.l'], $this->cal['members']['offtime'][$this->group]['f.l']);
     //var_dump( $this->cal['members']['all'][$this->group]['f.l'] ); exit();
     unset($this->cal['members']['work'][$this->group]['f.l'], $this->cal['members']['offtime'][$this->group]['f.l']);
     array_multisort($this->cal['members']['all'][$this->group]['f.l'], SORT_ASC, SORT_STRING);
     $this->cal['members']['all'][$this->group]['l.f'] = array_merge($this->cal['members']['work'][$this->group]['l.f'], $this->cal['members']['offtime'][$this->group]['l.f']);
     unset($this->cal['members']['work'][$this->group]['l.f'], $this->cal['members']['offtime'][$this->group]['l.f']);
     array_multisort($this->cal['members']['all'][$this->group]['l.f'], SORT_ASC, SORT_STRING);
     //exit();
 }
示例#22
0
 public function __construct()
 {
     parent::__construct("Navigation", "<a href='" . make_link() . "'>Index</a>", "left", 0);
 }
示例#23
0
 /**
  * RoomBlock constructor.
  * @param $id
  * @param $room
  * @param $start
  * @param $end
  * @param $weekday
  */
 function __construct($id, $room, $start, $end, $weekday)
 {
     parent::__construct($start, $end, $weekday);
     $this->id = $id;
     $this->room = $room;
 }
示例#24
0
 /**
  * Creates a new Result
  */
 public function __construct()
 {
     parent::__construct('search_results');
 }
示例#25
0
 public function __construct($attributes = array())
 {
     parent::__construct($attributes);
     Kio::addCssFile('blocks/shoutbox/shoutbox.css');
 }
示例#26
0
 public function __construct($scenario = 'insert')
 {
     // устанавливаем наш тип полю базового класса
     $this->type_of_block = self::TYPE_OF_BLOCK;
     parent::__construct($scenario);
 }
示例#27
0
 public function __construct()
 {
     $this->uniqid = uniqid('comp_');
     parent::__construct();
 }
 function __construct()
 {
     $block_options = array('name' => __('Text', 'oblivion'), 'size' => 'span3');
     //create the block
     parent::__construct('text_block', $block_options);
 }
示例#29
0
 /**
  * @param int $id
  * @param int $meta
  * @param string $name
  */
 public function __construct($id, $meta = 0, $name = "Unknown")
 {
     parent::__construct($id, $meta, $name);
 }
示例#30
0
 function __construct($block_id)
 {
     parent::__construct($block_id);
 }