<?php

class addFilmSegmentAction extends sfAction
{
  public function execute($request)
  {
  	if ($request->getMethodName() != sfWebRequest::POST) return sfView::ERROR;
  	
  	$in=$request->getParameter('timein');
	$out=$request->getParameter('timeout');
	$tag=addslashes($request->getParameter('usertag'));
	$user=addslashes($request->getParameter('username'));
	$refFilm=$request->getParameter('refFilm');
	$film=$request->getParameter('film');
	
	// Get file Path	
	$this->path = sfConfig::get('app_storage_uploads');	
	$this->format = sfConfig::get('app_storage_format');
	$file = $this->path.$refFilm.$this->format;
	
	
	
	// Build content to fill
	$line = array($in,$out,$tag,$user);
	
	// Build ldt
	

	// Create or Update the file
	$fp = fopen($file, "a");
	fwrite($fp,$line);
	fclose($fp);
	
	return sfView::SUCCESS;
  }
}