public function listAll(Request $request, $page = 1) { $page--; $total = Contract::all()->count(); $contracts = Contract::skip($page * self::PAGE_SIZE)->take(self::PAGE_SIZE)->get(); $response = ["contracts" => $contracts, "total" => $total, "page" => $page + 1, "page_size" => self::PAGE_SIZE]; return response()->json($response)->header('Access-Control-Allow-Origin', '*'); }
public function index() { $contracts = Contract::all(); $data = []; $data['title'] = 'Dependencias de la CDMX con Contrataciones Abiertas'; $data['description'] = 'Dependencias de la CDMX con Contrataciones Abiertas'; $data['og_image'] = "img/og/contrato-cdmx.png"; $data['body_class'] = 'dependencia'; //// lista de contratos aún sin implementar en el view $data['contracts'] = $contracts; return view("frontend.office")->with($data); }
public function show($id) { $supplier = Tenderer::where("id", $id)->get()->first(); $contracts = Contract::all(); $data = []; $data['title'] = $supplier->name; $data['description'] = 'Proveedor'; $data['og_image'] = "img/og/contrato-cdmx.png"; $data['body_class'] = 'proveedor'; $data['contracts'] = $contracts; $data['supplier'] = $supplier; return view("frontend.supplier")->with($data); }
public function updateContracts() { $contracts = Contract::all(); foreach ($contracts as $contract) { $data = ['dependencia' => '901', 'contrato' => $contract->ocdsid]; // [2.1] the CURL stuff $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL, $this->apiContrato); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data)); $result = curl_exec($ch); $con = json_decode($result); echo "<pre>"; var_dump($con); echo "</pre>"; } }
public function showAll() { $contracts = Contract::all(); return view("frontend.contracts.show-all")->with(["contracts" => $contracts]); }