當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Batches::addBatches方法代碼示例

本文整理匯總了PHP中Batches::addBatches方法的典型用法代碼示例。如果您正苦於以下問題:PHP Batches::addBatches方法的具體用法?PHP Batches::addBatches怎麽用?PHP Batches::addBatches使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Batches的用法示例。


在下文中一共展示了Batches::addBatches方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: index


//.........這裏部分代碼省略.........
             //Year.'-03-31');
             /*
              echo "<pre>";
             print_r($months);
             echo "</pre>";
             
             exit(); 
             */
             $i = 0;
             foreach ($months as $month) {
                 $yearAndMonth = explode('-', $month['month']);
                 $daysFound[$i] = getDaysFromMonth($yearAndMonth['1'], $yearAndMonth['0'], $day);
                 $i++;
             }
             $timeString = date('Y-m-d', strtotime($inputs['startDate'])) . $inputs['startTime'];
             $timestamp = strtotime($timeString);
             $startTime24Hours = date('H:i:s', $timestamp);
             $timeString = $endDateYear . '-3-5 ' . $inputs['endTime'];
             $timestamp = strtotime($timeString);
             $endTime24Hours = date('H:i:s', $timestamp);
             $batchSlug = Courses::getBatchID($courseId, $classId, $startDate, null, $inputs['selectSeason']);
             $inputBatch['batchName'] = $batchSlug;
             $inputBatch['classId'] = $classId;
             $inputBatch['courseId'] = $courseId;
             $inputBatch['startDate'] = $startDate->toDateString();
             $inputBatch['endDate'] = $endDate->toDateString();
             $inputBatch['season_id'] = $inputs['selectSeason'];
             $inputBatch['preferredTime'] = $startTime24Hours;
             $inputBatch['preferredEndTime'] = $endTime24Hours;
             $inputBatch['leadInstructor'] = $leadInstructor;
             $inputBatch['alternateInstructor'] = $alternateInstructor;
             $inputBatch['location_id'] = $inputs['seasonLocation'];
             //$inputBatch['classAmount']=$inputs['eachClassAmount'];
             $newBatch = Batches::addBatches($inputBatch);
             /*
             				$days = 1;
             				foreach($daysFound as $monthdays){
             					
             					foreach($monthdays as $dayFound){
             						
             						if($days <= 40){
             						$batchScheduleInput['batchId']      = $newBatch->id;
                             $batchScheduleInput['seasonId']      = $inputs['selectSeason'];
             						$batchScheduleInput['scheduleDate'] = $dayFound;
             						$batchScheduleInput['startTime']    = $startTime24Hours;
             						$batchScheduleInput['endTime']      = $endTime24Hours;
             						$batchScheduleInput['scheduleType']= 'class';
             						BatchSchedule::addSchedule($batchScheduleInput);
             						}
             						
             						$days++;
             					}
             				}
             */
             //calculating dates and adding all the dates to batchschedule for new batch
             $batch_schedule = new BatchSchedule();
             do {
                 $batchScheduleInput['batchId'] = $newBatch->id;
                 $batchScheduleInput['seasonId'] = $inputs['selectSeason'];
                 $batchScheduleInput['scheduleDate'] = $startDate->toDateString();
                 $batchScheduleInput['startTime'] = $startTime24Hours;
                 $batchScheduleInput['endTime'] = $endTime24Hours;
                 $batchScheduleInput['scheduleType'] = 'class';
                 BatchSchedule::addSchedule($batchScheduleInput);
                 $startDate->addDays(7);
             } while ($startDate->eq($endDate) == FALSE);
開發者ID:Headrun-php,項目名稱:TLG,代碼行數:67,代碼來源:BatchesController.php


注:本文中的Batches::addBatches方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。