/** * Display a listing of the resource. * * @return Response */ public function index() { // create new sitemap object $sitemap = App::make("sitemap"); // set cache (key (string), duration in minutes (Carbon|Datetime|int), turn on/off (boolean)) // by default cache is disabled $sitemap->setCache('laravel.sitemap', 3600); // check if there is cached sitemap and build new only if is not if (!$sitemap->isCached()) { // add item to the sitemap (url, date, priority, freq) $sitemap->add(URL::route('index'), '2015-04-18T12:24:11+00:00', '1.0', 'daily'); // get all posts from db $schools = School::all(); // add every post to the sitemap foreach ($schools as $school) { $images = array(array('url' => $school->cover_photo_url, 'title' => $school->name, 'caption' => $school->name)); foreach ($school->photos_data as $image) { $images[] = array('url' => $image->photo_url, 'title' => $school->name, 'caption' => $image->name); } $sitemap->add($school->school_url, $school->updated_at, '0.9', 'daily', $images); } } // show your sitemap (options: 'xml' (default), 'html', 'txt', 'ror-rss', 'ror-rdf') return $sitemap->render('xml'); }
public function getMyprofile() { $id = Auth::user()->id; $alumni_id = null; $sql = "SELECT * FROM alumni WHERE account_id = ?"; $prof = DB::select($sql, array($id)); if ($prof != null) { $alumni_id = $prof[0]->id; } $sql2 = "SELECT * FROM degree WHERE alumni_id = ?"; $deg = DB::select($sql2, array($alumni_id)); $sql3 = "SELECT * FROM work_experience WHERE alumni_id = ?"; $wrk_exp = DB::select($sql3, array($alumni_id)); $sql4 = "SELECT * FROM certificate WHERE alumni_id = ?"; $certificate = DB::select($sql4, array($alumni_id)); // $sql5 = "SELECT * FROM alumni_tracer WHERE alumni_id = ?"; $sql5 = "SELECT at.*, sq.question, sc.choice\n\t\t\t\tFROM alumni_tracer AS at\n\t\t\t\tINNER JOIN survey_questions AS sq\n\t\t\t\tON sq.id = at.question_id\n\t\t\t\tINNER JOIN survey_choices AS sc\n\t\t\t\tON sc.id = at.choice_id\n\t\t\t\tWHERE at.alumni_id = ?\n\t\t\t\tORDER BY at.question_id"; $a_tracer = DB::select($sql5, array($alumni_id)); $dept = Department::all(); $region = Region::all(); $province = Province::all(); $occupation = Occupation::all(); $company = Company::all(); $deg_title = DegreeTitle::all(); $school = School::all(); $jobs = Job::all(); $field = Field::all(); $questions = DB::select("SELECT * FROM survey_questions"); $civil_status = DB::select("SELECT * FROM civil_status"); return View::make('user.profile')->with('company', $company)->with('field', $field)->with('occupation', $occupation)->with('work_exp', $wrk_exp)->with('degree', $deg)->with('a_tracer', $a_tracer)->with('certificate', $certificate)->with('school', $school)->with('deg_title', $deg_title)->with('profile', $prof)->with('dept', $dept)->with('region', $region)->with('province', $province)->with('civil_status', $civil_status)->with('questions', $questions)->with('jobs', $jobs); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $statistics = (object) array('schools_count' => School::all()->count(), 'municipalities_count' => Municipality::all()->count(), 'visitor_likes_count' => VisitorLikes::all()->count(), 'visitor_comments_count' => VisitorComments::all()->count()); $home_schools = School::orderBy('created_at', 'desc')->take(5)->get(); $home_comments = VisitorComments::orderBy('created_at', 'desc')->take(5)->get(); return View::make('admin.home')->with('home_schools', $home_schools)->with('home_comments', $home_comments)->with('statistics', $statistics); }
public function index() { $schools = School::all(); $states = State::all(); $cities = City::where('state_id', '=', 25)->get(); $menu = 'data'; return View::make('schools.index', compact('schools', 'states', 'cities', 'menu')); }
public function index() { $schools = School::all(); $schoolNames = array(); foreach ($schools as $school) { array_push($schoolNames, $school->name); } sort($schoolNames); return View::make('content.schoolIndex')->with('schoolNames', $schoolNames); }
public function home() { $address = Address::findByIdentityId(1); $schools = School::all(0, 50); $teachers = Teacher::findBySchoolId(1); $studentContacts = StudentContact::findByStudentId(1); $classes = Sclass::findByTeacherId(1); $student = Student::findById(1); require_once 'views/identity/home.php'; }
public function listRecords() { $start = 0; $number = 50; if (isset($_POST['rStart'])) { $start = $_POST['rStart']; } if (isset($_POST['rNumber'])) { $number = $_POST['rNumber']; } else { $number = School::rowCount(); } $schools = School::all($start, $number); require_once 'views/school/list.php'; }
public function listClasses() { $start = 0; if (isset($_POST['rStart'])) { $start = $_POST['rStart']; } $number = 0; if (isset($_POST['rNumber'])) { $number = $_POST['rNumber']; } else { $number = Sclass::rowCount(); } $schoolList = School::all($start, $number); $classesAtSchool = ''; $schoolName = ''; if (isset($_POST['schoolID'])) { $classesAtSchool = Sclass::getAllClassesAtSchool($_POST['schoolID'], $start, $number); $schoolName = School::findById($_POST['schoolID']); $schoolName = $schoolName->getValues(); $schoolName = $schoolName['name']; } require_once 'views/class/listClasses.php'; }
$application->id_pelajar = (int) $_POST['id_pelajar']; $application->id_sekolah = (int) $_POST['sekolah']; $application->id_subjek = (int) $_POST['subjek']; $application->status = (int) $_POST['status']; if ($application->update()) { // $_SESSION['success'] = 'Application updated!'; header('Location: index.php?module=admin'); exit; } else { // $_SESSION['error'] = 'Failed to update application!'; } } ob_start(); $app = Application::findById($id); $pelajar = Student::findById($app->id_pelajar); $sekolahs = School::all(); $subjeks = Subject::ofSchool($app->id_sekolah); $statuses = Application::statuses(); ?> <div> <div> <h1>Kemaskini Permohonan <span class="text-muted">#<?php echo $id; ?> </span></h1> <hr /> </div> <form action="" class="form-horizontal" method="post" id="application-form"> <input type="hidden" name="id_pelajar" value="<?php echo $pelajar->id;
$app->get('/talent/:name', function ($name) use($app) { $app->response()->header('Content-Type', 'application/json'); try { $talent = Talent::with('questions')->where('name', '=', $name)->firstOrFail(); } catch (ModelNotFoundException $e) { $app->halt(404, 'Talent niet gevonden'); } echo $talent->toJson(); }); $app->get('/schooladvice', function () use($app) { $app->response()->header('Content-Type', 'application/json'); echo EducationLevel::SchoolAdvice()->get()->toJson(); }); $app->get('/schools', function () use($app) { $app->response()->header('Content-Type', 'application/json'); echo School::all()->toJson(); }); $app->get('/skills', function () use($app) { $app->response()->header('Content-Type', 'application/json'); echo Skill::all()->toJson(); }); $app->get('/occupation', function () use($app) { $app->response()->header('Content-Type', 'application/json'); echo Skill::all()->toJson(); }); $app->group('/user', function () use($app) { $app->options('/:name', function ($name) use($app) { $app->response()->header('Access-Control-Allow-Methods', 'PUT, GET, POST, DELETE, OPTIONS'); }); $app->options('/', function () use($app) { $app->response()->header('Access-Control-Allow-Methods', 'PUT, GET, POST, DELETE, OPTIONS');
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $schools = School::all(); //return $schools->toJson(); return view('layouts.schools', ['schools' => $teachers]); }
public function create() { // Get grades $grades = []; foreach (Grade::all() as $i) { $grades[] = $i->getValues(); } // Get Schools $schools = []; foreach (School::all() as $i) { $schools[] = $i->getValues(); } include_once 'views/student/create.php'; }
public function daftarsekolah() { $schools = School::all(); return View::make('schools.daftarsekolah', compact('schools'))->withTitle('Sekolah'); }
<?php $id = $_GET['id']; ob_start(); $app = Application::findById($id); $pelajar = Student::findById($app->id_pelajar); $bangsa = Student::bangsa(); $sekolahs = array(); array_map(function ($sekolah) { global $sekolahs; $sekolahs[$sekolah['id']] = $sekolah['nama']; }, School::all()); $subjeks = array(); array_map(function ($subjek) { global $subjeks; $subjeks[$subjek['id']] = $subjek['nama']; }, Subject::ofSchool($app->id_sekolah)); $statuses = array(); array_map(function ($status) { global $statuses; $statuses[$status['id']] = $status['nama']; }, Application::statuses()); $programmes = array(); array_map(function ($programme) { global $programmes; return $programmes[$programme['id']] = $programme['nama_panjang']; }, Programme::all()); ?> <div> <table class="table"> <tbody>