/[scire]/trunk/scire/.lib/DB_functions.php
Gentoo

Diff of /trunk/scire/.lib/DB_functions.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 306 Revision 307
353 if (!$result) { 353 if (!$result) {
354 return $db->error; 354 return $db->error;
355 } 355 }
356 356
357 if ($run_schedule != "") { 357 if ($run_schedule != "") {
358 print "Run schedule is $run_schedule<br>";
358 $cron = new CronParser($run_schedule); 359 $cron = new CronParser($run_schedule);
359 $nextRun = $cron->calculateNextRun(); 360 $nextRun = $cron->calculateNextRun();
360 var_dump($nextRun); 361 var_dump($nextRun);
361 $nextRun = mktime( $nextRun[1], $nextRun[0], 0, $nextRun[3], $nextRun[2], $nextRun[4] ); 362 $nextRun = mktime( $nextRun[1], $nextRun[0], 0, $nextRun[3], $nextRun[2], $nextRun[4] );
362 $expTime = $nextRun + ( $validity_period * 60); 363 $expTime = $nextRun + ( $validity_period * 60);
363 $nextRun = strftime( '%Y-%m-%d %T', $nextRun ); 364 $nextRun = strftime( '%Y-%m-%d %T', $nextRun );
364 $expTime = strftime( '%Y-%m-%d %T', $expTime ); 365 $expTime = strftime( '%Y-%m-%d %T', $expTime );
365 } else { 366 } else {
366 $nextRun = ""; 367 $nextRun = strftime( '%Y-%m-%d %T', time());
367 $expTime = ""; 368 $expTime = "";
368 } 369 }
369 # Add conditions 370 # Add conditions
370 $result = $db->insert('job_conditions', array('jobid' => $jobid, 'job_dependency' => $job_dependency, 'run_schedule' => $run_schedule, 'deploy_time' => $nextRun, 'expiration_time' => $expTime, 'validity_period' => $validity_period)); 371 $result = $db->insert('job_conditions', array('jobid' => $jobid, 'job_dependency' => $job_dependency, 'run_schedule' => $run_schedule, 'deploy_time' => $nextRun, 'expiration_time' => $expTime, 'validity_period' => $validity_period));
371 if (!$result) { 372 if (!$result) {

Legend:
Removed from v.306  
changed lines
  Added in v.307

  ViewVC Help
Powered by ViewVC 1.1.20