//echo $vv[count($vv)-1]."<br>";
//echo $newfilepath."<br>$filename"; die;
$handlew = fopen($newfilepath, "wb");
$csv_flag = 0;
if (($handle = fopen($filename, "r")) !== FALSE) {
    $i = 1;
    $quote_id = 0;
    while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
        //$newdata=$data;
        //$out =implode(",", $newdata);
        if ($i > 2) {
            if ($data[0] != "") {
                if ($i > 3) {
                    if ($quote_id != 0) {
                        $j = $i - 1;
                        $order_create = $create->createOrder($quote_id);
                        $quote_id = 0;
                        echo $data[1] . ",createOrder,{$i},{$quote_id}," . $order_create . "<br>";
                        //die;
                        $out = "order successfully {$order_create} \n";
                        //$out = "$out\n";
                        fwrite($handlew, $out);
                        Mage::unregister('shipping_cost');
                    }
                }
                //fputcsv($handle, "aaa");
                $out = implode(",", $data);
                //createquote
                $csv_order_no = $data[27];
                Mage::log('final quote- before', NULL, 'mohanorder.log');
                $result = $create->createQuote($data);