Пример #1
0
     $pc_data['repeat'] = 31;
 }
 Debug::Text('Repeating Punch For: ' . $pc_data['repeat'] . ' Days', __FILE__, __LINE__, __METHOD__, 10);
 for ($i = 0; $i <= (int) $pc_data['repeat']; $i++) {
     $pf = new PunchFactory();
     Debug::Text('Punch Repeat: ' . $i, __FILE__, __LINE__, __METHOD__, 10);
     if ($i == 0) {
         $time_stamp = $punch_full_time_stamp;
     } else {
         $time_stamp = $punch_full_time_stamp + 86400 * $i;
     }
     Debug::Text('Punch Full Time Stamp: ' . date('r', $time_stamp) . '(' . $time_stamp . ')', __FILE__, __LINE__, __METHOD__, 10);
     //Set User before setTimeStamp so rounding can be done properly.
     $pf->setUser($pc_data['user_id']);
     if ($i == 0) {
         $pf->setId($pc_data['punch_id']);
     }
     if (isset($data['transfer'])) {
         $pf->setTransfer(TRUE);
     }
     $pf->setType($pc_data['type_id']);
     $pf->setStatus($pc_data['status_id']);
     if (isset($pc_data['disable_rounding'])) {
         $enable_rounding = FALSE;
     } else {
         $enable_rounding = TRUE;
     }
     $pf->setTimeStamp($time_stamp, $enable_rounding);
     if ($i == 0 and isset($pc_data['id']) and $pc_data['id'] != '') {
         Debug::Text('Using existing Punch Control ID: ' . $pc_data['id'], __FILE__, __LINE__, __METHOD__, 10);
         $pf->setPunchControlID($pc_data['id']);