public function getReadDates() { $dates = fil_detail_production::all(); $out = []; foreach ($dates as $date) { $addToView = false; if ($date->detailProduct->serviceOrder->ser_auth_admin == 2 && $date->detailProduct->serviceOrder->ser_auth_production == 2 && $date->detailProduct->serviceOrder->ser_auth_sales == 2) { $addToView = true; } if ($addToView) { if ($date->dpr_status == 'Pendiente') { $out[] = array('id' => $date->dpr_id, 'title' => 'Grabación con el cliente ' . $date->detailProduct->serviceOrder->customer->cus_contact_first_name . ' ' . $date->detailProduct->serviceOrder->customer->cus_contact_last_name . ', Empresa: ' . $date->detailProduct->serviceOrder->customer->cus_commercial_name, 'url' => '', 'class' => 'event-important', 'start' => strtotime($date->dpr_recording_date) . '000', 'end' => strtotime($date->dpr_recording_date) . '000'); $out[] = array('id' => $date->dpr_id, 'title' => 'Entrega de la primera propuesta al cliente ' . $date->detailProduct->serviceOrder->customer->cus_contact_first_name . ' ' . $date->detailProduct->serviceOrder->customer->cus_contact_last_name . ', Empresa: ' . $date->detailProduct->serviceOrder->customer->cus_commercial_name, 'url' => '', 'class' => 'event-info', 'start' => strtotime($date->dpr_proposal_1_date) . '000', 'end' => strtotime($date->dpr_proposal_1_date) . '000'); $out[] = array('id' => $date->dpr_id, 'title' => 'Entrega de la segunda propuesta al cliente ' . $date->detailProduct->serviceOrder->customer->cus_contact_first_name . ' ' . $date->detailProduct->serviceOrder->customer->cus_contact_last_name . ', Empresa: ' . $date->detailProduct->serviceOrder->customer->cus_commercial_name, 'url' => '', 'class' => 'event-info', 'start' => strtotime($date->dpr_proposal_2_date) . '000', 'end' => strtotime($date->dpr_proposal_2_date) . '000'); } } } $response = Response::json(array('success' => 1, 'result' => $out)); return $response; }
public function postUpdateProductionDates() { $values = Request::all(); $detailProduction = fil_detail_production::find($values['dpr_id']); if ($detailProduction == null) { return Response::json(array('success' => false, 'data' => 'Detalle no encontrado')); } $detailProduction->dpr_recording_date = $values['dpr_recording_date']; $detailProduction->dpr_proposal_1_date = $values['dpr_proposal_1_date']; $detailProduction->dpr_proposal_2_date = $values['dpr_proposal_2_date']; $detailProduction->save(); return $this->jsonResponse($detailProduction->detailProduct->serviceOrder->ser_id); }