Ejemplo n.º 1
0
 public function postSynclegacy()
 {
     set_time_limit(0);
     $mymerchant = Merchant::where('group_id', 4)->get();
     $count = 0;
     foreach ($mymerchant->toArray() as $m) {
         $member = Member::where('legacyId', $m['id'])->first();
         if ($member) {
         } else {
             $member = new Member();
         }
         foreach ($m as $k => $v) {
             $member->{$k} = $v;
         }
         if (!isset($member->status)) {
             $member->status = 'inactive';
         }
         if (!isset($member->url)) {
             $member->url = '';
         }
         $member->legacyId = new MongoInt32($m['id']);
         $member->roleId = Prefs::getRoleId('Merchant');
         $member->unset('id');
         $member->save();
         $count++;
     }
     return Response::json(array('result' => 'OK', 'count' => $count));
 }
Ejemplo n.º 2
0
                        closedir($dh);
                    }
                }
            }
        }
    }
});
Route::get('pdf', function () {
    $content = "\n    <page>\n        <h1>Exemple d'utilisation</h1>\n        <br>\n        Ceci est un <b>exemple d'utilisation</b>\n        de <a href='http://html2pdf.fr/'>HTML2PDF</a>.<br>\n    </page>";
    $html2pdf = new HTML2PDF();
    $html2pdf->WriteHTML($content);
    $html2pdf->Output('exemple.pdf', 'D');
});
Route::get('smerchant', function () {
    $q = Input::get('term');
    $user = Merchant::where('group_id', 4)->where(function ($query) use($q) {
        $query->where('merchantname', 'like', '%' . $q . '%')->orWhere('fullname', 'like', '%' . $q . '%');
    })->get();
    print_r($user->toArray());
});
/*
Route::get('brochure/dl/{id}',function($id){

    $prop = Property::find($id)->toArray();

    //return View::make('print.brochure')->with('prop',$prop)->render();

    $content = View::make('print.brochure')->with('prop',$prop)->render();

    //return $content;
Ejemplo n.º 3
0
 public function getMerchant()
 {
     $q = Input::get('term');
     $user = Merchant::where('group_id', 4)->where(function ($query) use($q) {
         $query->where('merchantname', 'like', '%' . $q . '%')->orWhere('fullname', 'like', '%' . $q . '%');
     })->get();
     $result = array();
     foreach ($user->toArray() as $r) {
         $result[] = array('id' => $r['id'], 'value' => $r['merchantname'], 'email' => $r['email'], 'label' => $r['merchantname'] . ' ( ' . $r['email'] . ' )');
     }
     return Response::json($result);
 }
Ejemplo n.º 4
0
 public function merchantObject($merchant_id)
 {
     $merchant = \Merchant::where('id', '=', $merchant_id)->first();
     if ($merchant) {
         $merchant = $merchant->toArray();
         $nm = array();
         foreach ($merchant as $key => $value) {
             if (in_array($key, $this->merchant_unset)) {
             } else {
                 $nk = $this->underscoreToCamelCase($key);
                 $nm[$nk] = is_null($value) ? '' : $value;
             }
         }
         $nm['extId'] = $nm['id'];
         unset($nm['id']);
         return $nm;
     } else {
         return array();
     }
 }
Ejemplo n.º 5
0
 public static function getMerchant($key = null, $val = null, $order = null, $dir = null)
 {
     if (is_null($key)) {
         $c = Merchant::where('group_id', '=', 4)->orderBy('merchantname', 'asc')->get();
         self::$merchant = $c;
         return new self();
     } else {
         $c = Merchant::where($key, '=', $val)->first();
         self::$merchant = $c;
         return $c;
     }
 }