/** * Run the database seeds. * * @return void */ public function run() { $projectdetails = ['name' => 'shitzu', 'description' => 'frickzena oah auhsdoh vgos']; $taskdetails = ['name' => 'joozie', 'description' => 'ahioihd poaiy7u ascihogyfcd pouaou']; $taskdetails2 = ['name' => 'ambroze', 'description' => 'shitzu prickzen la frickzen']; $statusdetails = ['message' => 'hello wazzup?']; DB::table('projects')->delete(); DB::table('users_projects')->delete(); DB::table('stories')->delete(); DB::table('sprints')->delete(); DB::table('backlogs')->delete(); // optional DB::table('comments')->delete(); DB::table('statuses')->delete(); $user1 = User::firstOrFail(); $user2 = User::all()->last(); $project = Bus::dispatch(new CreateProject($user1, $projectdetails)); Bus::dispatch(new AddUserToProject($user1, $project, $user2, 'developer')); $users = User::whereIn('id', [$user1->id, $user2->id])->get(); $backlog = App\Backlog::create(['name' => 'Release Elixir']); $user1->backlogs()->save($backlog); $project->backlogs()->save($backlog); $sprint = App\Sprint::create(['name' => 'Sprint Shikku']); $project->sprints()->save($sprint); $backlog->sprints()->save($sprint); $user1->sprints()->save($sprint); $datas = [['name' => 'Refactoring Iceblocks', 'description' => 'Cool tasks are always cool. So do this !!', 'priority' => 1, 'work_hours' => '7'], ['name' => 'Streaming section', 'description' => 'This is one of the besttask ever i ve seen in my life time => )', 'priority' => 0, 'work_hours' => '2'], ['name' => 'Urgent Completion', 'description' => 'This is a urgent task . U should make the system flow for ever', 'priority' => 3, 'work_hours' => '8'], ['name' => 'Elangent Model shift', 'description' => 'Super awesome task you will love it i know ...!!', 'priority' => 2, 'work_hours' => '5'], ['name' => 'Bug trakking system', 'description' => 'This task is for powerful people.. Yeah you..! ', 'priority' => 1, 'work_hours' => '2'], ['name' => 'Featured blog completion', 'description' => 'This is a urgent task . U should make the system flow for ever', 'priority' => 3, 'work_hours' => '6'], ['name' => 'Quick finish', 'description' => 'Super awesome task you will love it i know it, can you just finish this.. ? sothat we can move On..', 'priority' => 0, 'work_hours' => '7'], ['name' => 'Trapped module refactoring', 'description' => 'Super awesome task you will love it i know ...!!', 'priority' => 3, 'work_hours' => '2'], ['name' => 'Smooth UI Design', 'description' => 'This is a urgent task . U should make the system flow for ever', 'priority' => 2, 'work_hours' => '4'], ['name' => 'Refactoring Iceblocks', 'description' => 'Major refactor needed in the sublimentory section of zylanfuzku Masked version.Its all about the stuffs and stone of the rechard steven.', 'priority' => 0, 'work_hours' => '7'], ['name' => 'Urgent Completion', 'description' => 'This is a urgent task . U should make the system flow for ever', 'priority' => 3, 'work_hours' => '8'], ['name' => 'Elangent Model shift', 'description' => 'Super awesome task you will love it i know ...!!', 'priority' => 2, 'work_hours' => '5'], ['name' => 'Bug trakking system', 'description' => 'This task is for powerful people.. Yeah you..! ', 'priority' => 1, 'work_hours' => '2'], ['name' => 'Featured blog completion', 'description' => 'This is a urgent task . U should make the system flow for ever', 'priority' => 3, 'work_hours' => '6'], ['name' => 'Quick finish', 'description' => 'Super awesome task you will love it i know it, can you just finish this.. ? sothat we can move On..', 'priority' => 0, 'work_hours' => '7'], ['name' => 'Trapped module refactoring', 'description' => 'Super awesome task you will love it i know ...!!', 'priority' => 3, 'work_hours' => '2'], ['name' => 'Quick finish', 'description' => 'Super awesome task you will love it i know it, can you just finish this.. ? sothat we can move On..', 'priority' => 0, 'work_hours' => '7'], ['name' => 'Trapped module refactoring', 'description' => 'Super awesome task you will love it i know ...!!', 'priority' => 3, 'work_hours' => '2'], ['name' => 'Smooth UI Design', 'description' => 'This is a urgent task . U should make the system flow for ever', 'priority' => 2, 'work_hours' => '4'], ['name' => 'Refactoring Iceblocks', 'description' => 'Major refactor needed in the sublimentory section of zylanfuzku Masked version.Its all about the stuffs and stone of the rechard steven.', 'priority' => 0, 'work_hours' => '7'], ['name' => 'Urgent Completion', 'description' => 'This is a urgent task . U should make the system flow for ever', 'priority' => 3, 'work_hours' => '8'], ['name' => 'Elangent Model shift', 'description' => 'Super awesome task you will love it i know ...!!', 'priority' => 2, 'work_hours' => '5'], ['name' => 'Bug trakking system', 'description' => 'This task is for powerful people.. Yeah you..! ', 'priority' => 1, 'work_hours' => '2'], ['name' => 'Featured blog completion', 'description' => 'This is a urgent task . U should make the system flow for ever', 'priority' => 3, 'work_hours' => '6'], ['name' => 'Quick finish', 'description' => 'Super awesome task you will love it i know it, can you just finish this.. ? sothat we can move On..', 'priority' => 0, 'work_hours' => '7'], ['name' => 'Trapped module refactoring', 'description' => 'Super awesome task you will love it i know ...!!', 'priority' => 3, 'work_hours' => '2'], ['name' => 'Quick finish', 'description' => 'Super awesome task you will love it i know it, can you just finish this.. ? sothat we can move On..', 'priority' => 0, 'work_hours' => '7'], ['name' => 'Trapped module refactoring', 'description' => 'Super awesome task you will love it i know ...!!', 'priority' => 3, 'work_hours' => '2']]; foreach ($datas as $data) { $story = App\Story::create($data); $project->stories()->save($story); $user1->createdStories()->save($story); } }
private function getBusByVariable($name, $busArray, $excpBusArray = array('')) { $goBus; $goBus['name'] = $name; $busArrayLength = sizeof($busArray); $busExcpLength = sizeof($excpBusArray); for ($i = 0, $j = 0; $i < $busArrayLength; $i++) { $bus = new Bus(); $stopByDorymitory = FALSE; $j = $j < $busExcpLength ? $j : $busExcpLength - 1; if ($busArray[$i] == $excpBusArray[$j]) { $j++; $stopByDorymitory = TRUE; } $bus->setTime($busArray[$i], $stopByDorymitory); $goBus[$i] = $bus; } return $goBus; }
public function getBookfinal() { //print_r(Input::all()); $input = Xmlbus::book(Input::all()); $data = Bus::destinationcities($input); $output = Xmltoarray::arr($data); //echo "<pre>"; //print_r($output); return View::make('retailer.bus.sucess')->with('bookroomoutput', $output); }
public function getSample() { $input = Xmlbus::city(); $data = Bus::cities($input); $output = Xmltoarray::arr($data); $city = $output['SOAP:ENVELOPE']['SOAP:BODY']['GETALLCITIESRESPONSE']['GETALLCITIESRESULT']['WSBUSCITYLIST']['WSBUSCITYLIST']; foreach ($city as $cities) { print_r($cities); echo "<pre>"; } }
public function queueTest() { $Collection = \Illuminate\Support\Collection::make(['0 . ', '1 . ', '2 . ', '3 . ', '4 . ']); foreach (range(0, 2) as $v) { $message = \Illuminate\Foundation\Inspiring::quote(); $job = (new \App\Jobs\PushMessage(1, $Collection->get($v)))->delay(20 * $v); \Bus::dispatch($job); } $job = (new \App\Jobs\PushMessage(1, $Collection->get(3), 1))->delay(20 * ($v + 1)); \Bus::dispatch($job); }
public function getSeatlayout() { $input = Xmlbus::seatlayout(Input::all()); //print_r($input); exit; $data = Bus::destinationcities($input); $output = Xmltoarray::arr($data); $html = $output['SOAP:ENVELOPE']['SOAP:BODY']['GETSEATLAYOUTRESPONSE']['GETSEATLAYOUTRESULT']['WSNEWSEATLAYOUTDETAILS']['HTMLLAYOUT']; //echo $html; $seatlayout = $output['SOAP:ENVELOPE']['SOAP:BODY']['GETSEATLAYOUTRESPONSE']['GETSEATLAYOUTRESULT']['WSNEWSEATLAYOUTDETAILS']['WSSEATLAYOUTSTRUCTURE']['OBJSTRUCTSEATDETAILS']['ARRAYOFWSBUSSEATDETAIL']; //echo json_encode($seatlayout); echo json_encode($seatlayout); }
<?php // this is to check if the user is the (owner), (owner + driver), or (owner + conductor) $bp = new BusPersonnel(); $routes = BusRoute::find_all(); $buses = Bus::find_all(); $bus_personnel = BusPersonnel::find_all(); $photo_types = $photo_type_object->get_photo_types("bus"); $photos_of_bus = $photo_object->get_photos('3', $_GET['busid']); //GET request stuff if (isset($_GET['busid'])) { $bus_to_read_update = $bus_object->find_by_id($_GET['busid']); $complaints_of_bus = $complaint_object->get_complaints_for_object(3, $_GET['busid']); $feedback_on_bus = $feedback_item_object->get_feedback_items_for_object(3, $_GET['busid']); } else { $session->message("No Bus ID provided to view."); redirect_to("admin-list-buses.php"); } //check login if ($session->is_logged_in()) { if ($session->object_type == 5) { //admin user $user = $admin_user_object->find_by_id($_SESSION['id']); $profile_picture = $photo_object->get_profile_picture($session->object_type, $user->id); if (isset($_POST['submit'])) { $bus_to_read_update->route_id = $_POST['route_id']; $bus_to_read_update->reg_number = $_POST['reg_number']; $bus_to_read_update->name = $_POST['name']; if ($bus_to_read_update->update()) { $session->message("Success! The Bus details were updated. "); redirect_to('admin-list-buses.php');
<?php //init code $routes = BusRoute::find_all(); //check login if ($session->is_logged_in()) { if ($session->object_type == 5) { //admin user $user = $admin_user_object->find_by_id($_SESSION['id']); $profile_picture = $photo_object->get_profile_picture($session->object_type, $user->id); if (isset($_POST['submit'])) { $bus_to_create = new Bus(); $bus_to_create->route_id = $_POST['route_id']; $bus_to_create->reg_number = $_POST['reg_number']; $bus_to_create->name = $_POST['name']; if ($bus_to_create->create()) { $session->message("Success! The new Bus has been added. "); redirect_to('admin-list-buses.php'); } else { $session->message("Error! The Bus could not be added. "); } } } else { //everyone else $session->message("Error! You do not have sufficient priviledges to view the requested page. "); redirect_to("./"); } } else { //not logged in... GTFO! $session->message("Error! You must login to view the requested page. "); redirect_to("login.php");
break; case 'SIX': $goals = 6; break; default: $goals = 0; break; } $bForm = (object) ['formid' => 'SpEd 6b', 'title' => 'SpEd 6b', 'responses' => [(object) ['field' => 'date-of-iep', 'type' => 'text', 'response' => $responses->get('date-of-iep')], (object) ['field' => 'correlate-with-transition-plan', 'type' => 'text', 'response' => $responses->get('correlate-with-transition-plan')]]]; $cForm = (object) ['formid' => 'SpEd 6c', 'title' => 'SpEd 6c', 'responses' => [(object) ['field' => 'goal-amount', 'type' => 'text', 'response' => $goals], (object) ['field' => 'date-of-iep', 'type' => 'text', 'response' => $responses->get('date-of-iep')]]]; if ($goals > 0) { for ($i = 1; $i <= $goals; $i++) { $cForm->responses[] = (object) ['field' => "goal{$i}-description", 'type' => 'text', 'response' => $responses->get("goal{$i}-description")]; $cForm->responses[] = (object) ['field' => "goal{$i}-measured", 'type' => 'checkbox', 'response' => $responses->get("goal{$i}-measured")]; $cForm->responses[] = (object) ['field' => "goal{$i}-measured-other", 'type' => 'text', 'response' => $responses->get("goal{$i}-measured-other")]; $cForm->responses[] = (object) ['field' => "goal{$i}-report", 'type' => 'checkbox', 'response' => $responses->get("goal{$i}-report")]; $cForm->responses[] = (object) ['field' => "goal{$i}-report-other", 'type' => 'text', 'response' => $responses->get("goal{$i}-report-other")]; $cForm->responses[] = (object) ['field' => "goal{$i}-progress-date1", 'type' => 'text', 'response' => $responses->get("goal{$i}-progress-date1")]; $cForm->responses[] = (object) ['field' => "goal{$i}-progress-code1", 'type' => 'text', 'response' => $responses->get("goal{$i}-progress-code1")]; $cForm->responses[] = (object) ['field' => "goal{$i}-progress-date2", 'type' => 'text', 'response' => $responses->get("goal{$i}-progress-date2")]; $cForm->responses[] = (object) ['field' => "goal{$i}-progress-code2", 'type' => 'text', 'response' => $responses->get("goal{$i}-progress-code2")]; $cForm->responses[] = (object) ['field' => "goal{$i}-progress-date3", 'type' => 'text', 'response' => $responses->get("goal{$i}-progress-date3")]; $cForm->responses[] = (object) ['field' => "goal{$i}-progress-code3", 'type' => 'text', 'response' => $responses->get("goal{$i}-progress-code3")]; $cForm->responses[] = (object) ['field' => "goal{$i}-progress-date4", 'type' => 'text', 'response' => $responses->get("goal{$i}-progress-date4")]; $cForm->responses[] = (object) ['field' => "goal{$i}-progress-code4", 'type' => 'text', 'response' => $responses->get("goal{$i}-progress-code4")]; $cForm->responses[] = (object) ['field' => "goal{$i}-short-term-objectives", 'type' => 'text', 'response' => $responses->get("goal{$i}-short-term-objectives")]; } } $files[] = Bus::dispatch(new App\Iep\Legacy\Commands\FillPdfCommand($student, json_encode([$bForm]), $event->fileOption, $event->watermarkOption))['file']; $files[] = Bus::dispatch(new App\Iep\Legacy\Commands\FillPdfCommand($student, json_encode([$cForm]), $event->fileOption, $event->watermarkOption))['file']; echo json_encode($files);
public function testTaskOwnership() { $project = Project::has('users', '>', 1)->first(); $user1 = $project->users()->wherePrivilegeLevel('1')->first(); $user2 = $project->users()->where('id', '!=', $user1->id)->first(); // echo "users {$user1->id} {$user2->id}"; $users = User::whereIn('id', [$user1->id, $user2->id])->get(); $this->assertNotNull($users); $this->assertEquals(2, $users->count()); $task = Bus::dispatch(new CreateTask($user1, ['name' => 'poopech'], $project, null, $users)); $this->assertTrue($task->users->contains($user1->id)); $this->assertTrue($task->users->contains($user2->id)); }
public function stestJoinChat() { $user = User::firstOrFail(); $chat = Chat::create($this->chatroomdata); $action = Bus::dispatch(new JoinChat($user, $chat)); // add $this->assertNull($action->admin); $this->assertTrue($chat->users->contains($user->id)); $this->assertEquals(1, $chat->messages->count()); $this->assertEquals(1, $chat->users->count()); $action = Bus::dispatch(new LeaveChat($user, $chat)); // remove $this->assertEquals(2, Message::count()); // $this->assertEquals(0, $chat->users->count()); $admin = User::all()->last(); $this->assertNotNull($admin); $this->assertNotEquals($admin->id, $user->id); $action = Bus::dispatch(new JoinChat($user, $chat, $admin)); // add $this->assertEquals($action->admin->id, $admin->id); $action = Bus::dispatch(new LeaveChat($user, $chat, $admin)); // remove }
* To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ class Car { public function myName() { //self::getName; $this->getName(); } public function getName() { echo "I am a car \n"; } } class Bus extends Car { public function getName() { echo "I am a Bus \n"; } } $crick = new Bus(); $crick->myName(); echo '<br>'; $abcd = new Car(); $abcd->myName(); echo '<br>'; $bcd = new Bus(); $bcd->getName();
/** * Create bus and link it with stop * * @var $bus object * @var $stop object * @var $bus_name string * @return object */ protected function create_bus($bus, $stop, $bus_name) { if (!isset($bus['route'])) { return array(); } $bus = new Bus(array('route' => $bus['route'], 'number' => $bus_name)); $bus->save(); $stop_bus = new StopBusPivotal(array('stop_id' => $stop->id, 'bus_id' => $bus->id)); $stop_bus->timestamps = false; $stop_bus->save(); return $bus; }
<?php // // // @title Second Object // // A file to show off object functions class Bus { public function horn() { return "HONK HONK!"; } } $redBus = new Bus(); echo $redBus->horn();