Subversion Repositories SmartDukaan

Rev

Rev 15583 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
14818 anikendra 1
<?php
2
class ActivationcodeShell extends AppShell {
3
    public $uses = array('ActivationCode');
4
 
5
    public function main() {
15767 anikendra 6
	$file = fopen("codes.csv","r");
7
	while(! feof($file)) {
8
		$row = fgetcsv($file);
9
		//print_r($row[0]);
10
		$this->ActivationCode->create();
11
		try { 
12
			$this->ActivationCode->save(array('code' => $row[0]));	
13
		}catch(Exception $ex) {
14
			$this->out($ex->getMessage());
15583 anikendra 15
		}
15767 anikendra 16
	}
14818 anikendra 17
    }
18
}