コード例 #1
0
 public function getPrintlabel($sessionname, $printparam, $format = 'html')
 {
     $pr = explode(':', $printparam);
     //2:150:250:300:8:10:12:barcode:undefined:undefined
     $columns = $pr[0];
     $resolution = $pr[1];
     $cell_width = $pr[2];
     $cell_height = $pr[3];
     $margin_right = $pr[4];
     $margin_bottom = $pr[5];
     $font_size = $pr[6];
     $code_type = $pr[7];
     $left_offset = $pr[8];
     $top_offset = $pr[9];
     $session = Printsession::find($sessionname)->toArray();
     $labels = Rack::whereIn('_id', $session)->get()->toArray();
     $skus = array();
     foreach ($labels as $l) {
         $skus[] = $l['SKU'];
     }
     $skus = array_unique($skus);
     $products = Rack::whereIn('SKU', $skus)->get()->toArray();
     $plist = array();
     foreach ($products as $product) {
         $plist[$product['SKU']] = $product;
     }
     return View::make('rack.printlabel')->with('columns', $columns)->with('resolution', $resolution)->with('cell_width', $cell_width)->with('cell_height', $cell_height)->with('margin_right', $margin_right)->with('margin_bottom', $margin_bottom)->with('font_size', $font_size)->with('code_type', $code_type)->with('left_offset', $left_offset)->with('top_offset', $top_offset)->with('products', $plist)->with('labels', $labels);
 }