public function project($peopleId, $projectId)
 {
     if ($alert = Session::get('alert')) {
         $param['alert'] = $alert;
     }
     $user_id = Session::get('user_id');
     $param['member'] = MembersModel::find($user_id);
     $param['people'] = PeopleModel::find($peopleId);
     $param['pageNo'] = 7;
     $param['noteType'] = NoteTypeModel::whereRaw(true)->orderBy('notesType', 'asc')->get();
     $param['noteCommType'] = NoteCommTypeModel::whereRaw(true)->orderBy('noteCommType', 'asc')->get();
     $param['noteAssign'] = NoteAssignModel::whereRaw(true)->orderBy('noteAssign', 'asc')->get();
     $param['noteStatus'] = NoteStatusModel::whereRaw(true)->orderBy('notesStatus', 'asc')->get();
     $param['noteTypeDetails'] = NoteTypeDetailsModel::whereRaw(true)->orderBy('noteTypeDetails', 'asc')->get();
     $param['projectType'] = ProjectTypeModel::whereRaw(true)->orderBy('type', 'asc')->get();
     $param['unit'] = UnitModel::whereRaw(true)->orderBy('unit', 'asc')->get();
     $param['velocityUnit'] = VelocityUnitModel::whereRaw(true)->orderBy('unit', 'asc')->get();
     $param['tempUnit'] = TempUnitModel::whereRaw(true)->orderBy('unit', 'asc')->get();
     $param['members'] = MembersModel::whereRaw(true)->orderBy('first_name', 'asc')->get();
     $note = NoteModel::whereRaw('peopleId=?', array($peopleId))->get();
     $param['project'] = ProjectModel::find($projectId);
     $param['note'] = $note;
     $param['projectZone'] = ProjectZoneModel::whereRaw('projectId =?', array($projectId))->get();
     $param['quote'] = QuoteModel::whereRaw('projectId =?', array($projectId))->get();
     $list = "";
     for ($i = 0; $i < count($note); $i++) {
         $list .= '<div class="col-md-12 margin-bottom-20 forest-change-note-header">';
         if (strtoupper($note[$i]->noteCommType->noteCommType) == "PHONE") {
             $list .= '<div class="panel panel-blue margin-bottom-40">';
         } else {
             if (strtoupper($note[$i]->noteCommType->noteCommType) == "EMAIL") {
                 $list .= '<div class="panel panel-green margin-bottom-40">';
             }
         }
         $list .= '<div class="panel-heading forest-panel-heading-note">';
         $list .= '<h3 class="panel-title forest-panel-title-note">';
         if (strtoupper($note[$i]->noteCommType->noteCommType) == "PHONE") {
             $list .= '<img src="/images/Modern-Phone-icon.jpg" style="width:30px; height:30px;">';
         } else {
             if (strtoupper($note[$i]->noteCommType->noteCommType) == "EMAIL") {
                 $list .= '<img src="/images/Email.png" style="width:30px; height:30px;">';
             }
         }
         $list .= '<a href = "javascript:void(0)" onclick = "onEditNoteChange(' . $note[$i]->id . ')">Edit</a>';
         $list .= '<span>(' . ucfirst($note[$i]->noteType->notesType) . ')</span>';
         $list .= '<span>(' . substr($note[$i]->updated_at, 0, 16) . ')</span>';
         $list .= '<span>(' . ucfirst($note[$i]->noteStatus->notesStatus) . ')</span>';
         $list .= ' </h3>
                             </div>
                             <div class="panel-body">';
         $list .= $note[$i]->notes;
         $list .= ' </div>
                          </div>
                       </div>';
     }
     $param['list'] = $list;
     return View::make('user.project.editQuote')->with($param);
 }
 public function project($peopleId, $projectId)
 {
     if ($alert = Session::get('alert')) {
         $param['alert'] = $alert;
     }
     $param['pageNo'] = 61;
     $param['people'] = PeopleModel::find($peopleId);
     $param['project'] = ProjectModel::find($projectId);
     $param['projectZone'] = ProjectZoneModel::whereRaw('projectId =?', array($projectId))->get();
     $param['quote'] = QuoteModel::whereRaw('projectId =?', array($projectId))->get();
     $param['note'] = NoteModel::whereRaw('peopleId=?', array($peopleId))->get();
     $note = NoteModel::whereRaw('peopleId=?', array($peopleId))->get();
     $list = "";
     for ($i = 0; $i < count($note); $i++) {
         $list .= '<div class="col-md-12 margin-bottom-10 forest-change-note-header">';
         if (strtoupper($note[$i]->noteCommType->noteCommType) == "PHONE") {
             $list .= '<div class="panel panel-blue margin-bottom-20" >';
         } else {
             if (strtoupper($note[$i]->noteCommType->noteCommType) == "EMAIL") {
                 $list .= '<div class="panel panel-green margin-bottom-20" >';
             }
         }
         if (strtoupper($note[$i]->noteCommType->noteCommType) == "PHONE") {
             $list .= '<div class="panel-heading forest-panel-heading-note" style="background: #3498db; ">';
         } else {
             if (strtoupper($note[$i]->noteCommType->noteCommType) == "EMAIL") {
                 $list .= '<div class="panel-heading forest-panel-heading-note" style="background: #2ecc71;">';
             }
         }
         $list .= '<h3 class="panel-title forest-panel-title-note">';
         if (strtoupper($note[$i]->noteCommType->noteCommType) == "PHONE") {
             $list .= '<img src="/images/Modern-Phone-icon.jpg" style="width:30px; height:30px;">';
         } else {
             if (strtoupper($note[$i]->noteCommType->noteCommType) == "EMAIL") {
                 $list .= '<img src="/images/Email.png" style="width:30px; height:30px;">';
             }
         }
         $list .= '<span>(' . ucfirst($note[$i]->noteType->notesType) . ')</span>';
         $list .= '<span>(' . substr($note[$i]->updated_at, 0, 16) . ')</span>';
         $list .= '<span>(' . ucfirst($note[$i]->noteStatus->notesStatus) . ')</span>';
         $list .= ' </h3>
                             </div>
                             <div class="panel-body">';
         $list .= $note[$i]->notes;
         $list .= ' </div>
                          </div>
                       </div>';
     }
     $param['list'] = $list;
     return View::make('admin.contact.project')->with($param);
 }
 public function getNoteContact()
 {
     if (Request::ajax()) {
         $onSearchNoteName = Input::get('onSearchNoteName');
         $onSearchType = Input::get('onSearchType');
         $onSearchCommType = Input::get('onSearchCommType');
         $onNoteStatus = Input::get('onNoteStatus');
         $onNoteAssign = Input::get('onNoteAssign');
         $dateRangeFrom = Input::get('dateRangeFrom');
         $dateRangeTo = Input::get('dateRangeTo');
         if ($onSearchNoteName == "" && $onSearchType == "" && $onSearchCommType == "" && $onNoteStatus == "" && $dateRangeFrom == "" && $dateRangeTo == "" && $onNoteAssign == "") {
             $note = NoteModel::all();
         } else {
             $query = NoteModel::whereRaw(true);
             if ($onSearchNoteName != "") {
                 $query->where('notes', 'like', '%' . $onSearchNoteName . '%');
             }
             if ($onSearchType != "") {
                 $query->where('notesTypeId', '=', $onSearchType);
             }
             if ($onSearchCommType != "") {
                 $query->where('notesCommTypeId', '=', $onSearchCommType);
             }
             if ($onNoteStatus != "") {
                 $query->where('notesStatusId', '=', $onNoteStatus);
             }
             if ($onNoteAssign != "") {
                 $query->where('notesAssignId', '=', $onNoteAssign);
             }
             if ($dateRangeFrom != "") {
                 $query->where('created_at', '>=', $dateRangeFrom);
             }
             if ($dateRangeTo != "") {
                 $query->where('created_at', '<', $dateRangeTo);
             }
             $note = $query->get();
         }
         if (count($note) > 0) {
             $list = '';
             $list .= '<div class="row">';
             for ($i = 0; $i < count($note); $i++) {
                 $list .= '<div class="col-md-10 col-md-offset-1 margin-bottom-20 forest-change-note-header">';
                 if (strtoupper($note[$i]->noteCommType->noteCommType) == "PHONE") {
                     $list .= '<div class="panel panel-blue margin-bottom-40">';
                 } else {
                     if (strtoupper($note[$i]->noteCommType->noteCommType) == "EMAIL") {
                         $list .= '<div class="panel panel-green margin-bottom-40">';
                     }
                 }
                 $list .= '<div class="panel-heading forest-panel-heading-note">';
                 $list .= '<div class="row">';
                 $list .= '<div class="col-md-8">';
                 $list .= '<h3 class="panel-title forest-panel-title-note">';
                 if (strtoupper($note[$i]->noteCommType->noteCommType) == "PHONE") {
                     $list .= '<img src="/images/Modern-Phone-icon.jpg" style="width:30px; height:30px;">';
                 } else {
                     if (strtoupper($note[$i]->noteCommType->noteCommType) == "EMAIL") {
                         $list .= '<img src="/images/Email.png" style="width:30px; height:30px;">';
                     }
                 }
                 $list .= '<a href = "javascript:void(0)" onclick = "onEditNoteChange(' . $note[$i]->id . ')">Edit</a>';
                 $list .= '<span>(' . ucfirst($note[$i]->noteType->notesType) . ')</span>';
                 $list .= '<span>(' . substr($note[$i]->updated_at, 0, 16) . ')</span>';
                 $list .= '<span>(' . ucfirst($note[$i]->noteStatus->notesStatus) . ')</span>';
                 $list .= ' </h3>
                            </div>';
                 $list .= '<div class="col-md-4 text-right">';
                 $list .= '<a href="' . URL::route("user.contact.main", $note[$i]->peopleId) . '" style="color:white; margin-right:20px">Contact</a>';
                 $list .= '</div>
                         </div>
                     </div>
                             <div class="panel-body">';
                 $list .= $note[$i]->notes;
                 $list .= ' </div>
                          </div>
                     </div>';
             }
             $list .= '</div>';
             return Response::json(['result' => 'success', 'list' => $list, 'countList' => count($note)]);
         } else {
             return Response::json(['result' => 'empty', 'message' => "This contact don't have note  for your request."]);
         }
     }
 }