/** * Run the database seeds. * * @return void */ public function run() { DB::table('goals')->insert([['name' => 'Transform Communities', 'bpid' => 2, 'group' => 1, 'bp' => true], ['name' => 'Evolve our Digital Environment', 'bpid' => 2, 'group' => 1, 'bp' => true], ['name' => 'Act as a catalyst for learning, discovery, and creating', 'bpid' => 2, 'group' => 1, 'bp' => true], ['name' => 'Evolve the EPL brand', 'bpid' => 2, 'group' => 3, 'bp' => true], ['name' => 'Transition the way we do Business', 'bpid' => 1, 'group' => 1, 'bp' => true], ['name' => 'Develop Better Customer Service', 'bpid' => 1, 'group' => 2, 'bp' => true], ['name' => 'IT Services Departmental Goals', 'bpid' => 2, 'group' => 1, 'bp' => false]]); for ($i = 1; $i <= App\Goal::All()->Count(); $i++) { DB::table('goals')->where('id', $i)->update(array('ident' => $i)); } }
/** * Run the database seeds. * * @return void */ public function run() { DB::table('objectives')->insert([['name' => 'We Identify and meet community needs', 'goal_id' => 1, 'group' => 1], ['name' => 'We Reduce barriers to accessing library services', 'goal_id' => 1, 'group' => 1], ['name' => 'Online services are highly used and valued', 'goal_id' => 2, 'group' => 1], ['name' => 'Together with our community we provide successful, meaningful services that are highly rates and heavily used', 'goal_id' => 1, 'group' => 2], ['name' => 'Edmontonians view EPL as integral to their lifelong formal and informal learning.', 'goal_id' => 3, 'group' => 2], ['name' => 'Promote upcoming technology', 'goal_id' => 2, 'group' => 3], ['name' => 'Increase eBook availability', 'goal_id' => 2, 'group' => 7], ['name' => 'Design new EPL logo for 2017', 'goal_id' => 4, 'group' => 3], ['name' => 'Entice high end speakers to come at no or low cost', 'goal_id' => 5, 'group' => 4], ['name' => 'Incentives for employees with good service', 'goal_id' => 6, 'group' => 5], ['name' => 'Entice high end speakers to come at no or low cost', 'goal_id' => 5, 'group' => 4], ['name' => 'Incentives for employees with good service', 'goal_id' => 6, 'group' => 5], ['name' => 'Upgrade IT software and hardware', 'goal_id' => 7, 'group' => 1], ['name' => 'Improve IT related services', 'goal_id' => 7, 'group' => 1]]); //Generate Idents for Objectives. for ($j = 1; $j <= App\Goal::All()->Count(); $j++) { global $goal; $goal = DB::table('goals')->where('id', $j)->first(); for ($i = 1, $k = 1; $i <= App\Objective::All()->Count(); $i++) { $obj = DB::table('objectives')->where('id', $i)->first(); if ($obj->goal_id == $goal->id) { DB::table('objectives')->where('id', $i)->update(array('ident' => $j . '.' . $k)); $k++; } } } }