* update upgrade.

This commit is contained in:
shiyangyangwork@yahoo.cn
2012-09-02 07:44:37 +00:00
parent fcb241632e
commit e3912d8f0d
12 changed files with 78 additions and 38 deletions

View File

@@ -434,42 +434,6 @@ class testcase extends control
die(js::reload('parent'));
}
public function import($productID)
{
$this->testcase->setMenu($this->products, $productID);
if($_FILES)
{
$savePath = $this->app->getAppRoot() . "www/data/upload/{$this->app->company->id}/" . date('Ym/', time());
if(!file_exists($savePath)) @mkdir($savePath, 0777, true);
move_uploaded_file($_FILES['file']['tmp_name'], $savePath . $_FILES['file']['name']);
$file = $savePath . $_FILES['file']['name'];
$row = 1;
$handle = fopen($file, "r");
$result = array();
while($data = fgetcsv($handle))
{
$result[$row++] = $data;
/*
$num = count($data);
echo "<p> $num fields in line $row: <br>\n";
$row++;
for ($c=0; $c < $num; $c++) {
echo $data[$c] . "<br>\n";
}
*/
}
fclose($handle);
$this->view->fileType = $this->post->fileType;
$this->view->result = $result;
$this->display();
}
$this->view->result = array();
$this->display();
}
/**
* export
*