/** * Display a listing of the resource. * * @return Response */ public function getReport() { $agend_id = Sentry::getUser()->id; $for_sale_count = Profolio::where('purpose', '=', 'For Sale')->where('agent_id', $agend_id)->count(); $for_rent_count = Profolio::where('agent_id', $agend_id)->where('purpose', '=', 'For Rent')->count(); $total = Profolio::where('agent_id', $agend_id)->count(); $propertyDate = PropertyHits::where('property_id', '=', 1)->groupBy('hits_on')->get(); $propertyHits = PropertyHits::where('property_id', '=', 1)->select(DB::raw('COUNT(hits_on) as totalHits'))->groupBy('hits_on')->get(); $data = array(); foreach ($propertyHits as $key => $value) { $data[] = $value->totalHits; } $data = str_replace('"', "", json_encode($data)); return View::make('report.report')->with('total', $total)->with('date', $propertyDate->lists('hits_on'))->with('totalHits', $data)->with('forRent', $for_rent_count)->with('forSale', $for_sale_count); }
public function getAsap() { $records = Emails::all(); foreach ($records as $record) { $receive_alert = $record->receive_alert; } if ($receive_alert = 'ASAP') { $records = Emails::where('receive_alert', $receive_alert)->get(); foreach ($records as $record) { $id = $record->user_id; $emls = User::where('id', $id)->get(); foreach ($emls as $eml) { $adr = $eml->email; } $property = Profolio::where('asap', 1)->get(); if ($property->isEmpty()) { echo "no property added"; } else { $to = $adr; $subject = 'New property Add on zameen jayedad'; $message = null; foreach ($property as $propertys) { $message .= '<html> <body> <table width="740px;" class="MsoTableLightShadingAccent1" border="1" cellspacing="0" cellpadding="0" style="color:#333; border-collapse:collapse;border:none; font-family: Helvetica, Arial, sans-serif; text-align: center; width=740px;"> <tr> <td align="center" width="250px;" style="border: 1px solid #333; width=150px; transition: all 0.3s; background: #FAFAFA; text-align: center; " ><b> App Type </b></td> <td align="center" style="border: 1px solid #333; width=370px; transition: all 0.3s; background: #FAFAFA; text-align: center; " >' . $propertys->property_type . '</td> </tr> <tr> <td align="center" width="250px;" style="border: 1px solid #333; width=150px; transition: all 0.3s; background: #FAFAFA; text-align: center; " ><b> purpose </b></td> <td align="center" style="border: 1px solid #333; width=370px; transition: all 0.3s; background: #FAFAFA; text-align: center; " >' . $propertys->purpose . '</td> </tr> <tr> <td align="center" width="250px;" style="border: 1px solid #333; width=150px; transition: all 0.3s; background: #FAFAFA; text-align: center; " ><b> Address </b></td> <td align="center" style="border: 1px solid #333; width=370px; transition: all 0.3s; background: #FAFAFA; text-align: center; " >' . $propertys->location . '</td> </tr> <tr> <td align="center" width="250px;" style="border: 1px solid #333; width=150px; transition: all 0.3s; background: #FAFAFA; text-align: center; " ><b> photo </b></td> <td align="center" style="border: 1px solid #333; width=370px; transition: all 0.3s; background: #FAFAFA; text-align: center; " ><img width="200" height="150" src="http://zameenjayedad.com.pk/uploads/photos/' . $propertys->photo . '"</td> </tr> <tr> <td align="center" width="250px;" style="border: 1px solid #333; width=150px; transition: all 0.3s; background: #FAFAFA; text-align: center; " ><b> App Logo </b></td> <td align="center" style="border: 1px solid #333; width=370px; transition: all 0.3s; background: #FAFAFA; text-align: center; " > <a href="http://zameenjayedad.com.pk/dashboard/listing/guest/' . $propertys->id . '">Detail</a></td> </tr> </table> </body> </html> <br/>'; } // $URL ='Property type :'.$propertys->property_type.'<br/>'.'purpose :'.$propertys->purpose.'<br/>'.'location :'.$propertys->location.'<br/>' // .'budget :'.$propertys->budget.'Area :'.$propertys->l_area.'<br/>'.'Contact Person :'.$propertys->contact_p.'<br/>' // .'Cell Num :'.$propertys->cell.'<br/>'.'Email :'.$propertys->email; // $this->sendTo($adr,array('activationCode'=>$URL)); $headers = "From: " . strip_tags('zameenjayedad.com') . "\r\n"; $headers .= "Reply-To: " . strip_tags('zameenjayedad.com') . "\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; mail($to, $subject, $message, $headers); DB::table('property')->where('asap', 1)->update(array('asap' => 0)); } } } }
public function getdeletelisting($id) { $profile = Profolio::find($id); $profile->delete(); return Redirect::to('profolio/listing'); }
public function Postmap() { $q = Input::get('query'); if (!$q) { return Redirect::to('dashboard/guest')->with('error', 'Please enter a search term.'); } $records = Profolio::where('location', 'LIKE', '%' . $q . '%')->orWhere('property_type', 'LIKE', '%' . $q . '%')->orWhere('purpose', 'LIKE', '%' . $q . '%')->orWhere('wanted', 'LIKE', '%' . $q . '%')->orWhere('location', 'LIKE', '%' . $q . '%')->orWhere('p_title', 'LIKE', '%' . $q . '%')->orWhere('unit', 'LIKE', '%' . $q . '%')->get(); return View::make('dashboard.map')->with('records', $records); }