/** * Test getter/setter job */ public function testGetSetJob() { $this->assertEmpty($this->jobInstance->getJob()); $expectedConfiguration = array('key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3'); $mockJob = $this->getMockBuilder('Akeneo\\Bundle\\BatchBundle\\Job\\Job')->disableOriginalConstructor()->getMock(); $mockJob->expects($this->any())->method('getConfiguration')->will($this->returnValue($expectedConfiguration)); $this->assertEntity($this->jobInstance->setJob($mockJob)); $this->assertEquals($expectedConfiguration, $this->jobInstance->getRawConfiguration()); $this->assertEquals($mockJob, $this->jobInstance->getJob()); }
private static function outputJob($jobId) { $job = Job::getJob($jobId); $output = ""; $output .= "Job with ID: " . Job::getJobId($job) . "<br>\n"; /* Display a short table with information */ $output .= "<table border=\"1\">\n"; /* header */ $output .= "<tr>\n"; $output .= "<th>Region</th>\n"; $output .= "<th>District</th>\n"; $output .= "<th>WorkType</th>\n"; $output .= "<th>Category</th>\n"; $output .= "<th>SubCategory</th>\n"; $output .= "<th>Job Title</th>\n"; $output .= "<th>Job Description</th>\n"; $output .= "<th>Salary Range</th>\n"; $output .= "<th>Start Date</th>\n"; $output .= "<th>End Date</th>\n"; $output .= "</tr>\n"; $output .= "<tr>\n"; $output .= "<td>" . Job::getRegion($job) . "</td>\n"; $output .= "<td>" . Job::getDistrict($job) . "</td>\n"; $output .= "<td>" . Job::getWorkType($job) . "</td>\n"; $output .= "<td>" . Job::getJobCategory($job) . "</td>\n"; $output .= "<td>" . Job::getJobSubCategory($job) . "</td>\n"; $output .= "<td>" . Job::getJobTitle($job) . "</td>\n"; $output .= "<td>" . Job::getJobDescription($job) . "</td>\n"; /* These last fields need formatting */ $formattedSalaryLow = sprintf("%-6d", Job::getSalaryLow($job)); $formattedSalaryHigh = sprintf("%-6d", Job::getSalaryHigh($job)); $startDate = new DateTime(Job::getDateOfAdvertisement($job)); $formattedStartDate = $startDate->format("j M Y"); $endDate = new DateTime(Job::getEndDateOfAdvertisement($job)); $formattedEndDate = $endDate->format("D, j M Y"); $output .= "<td>\${$formattedSalaryLow} - \${$formattedSalaryHigh}</td>\n"; $output .= "<td>{$formattedStartDate}</td>\n"; $output .= "<td>{$formattedEndDate}</td>\n"; $output .= "</tr>"; $output .= "</table>\n"; return $output; }
/* This program is free software. You can redistribute it and/or */ /* modify it under the terms of the GNU General Public License */ /* as published by the Free Software Foundation. */ /***********************************************************************/ // $Id$ $_user_location = 'public'; define(AT_INCLUDE_PATH, '../../include/'); include AT_INCLUDE_PATH . 'vitals.inc.php'; include AT_JB_INCLUDE . 'classes/Job.class.php'; $_custom_css = $_base_path . AT_JB_BASENAME . 'module.css'; // use a custom stylesheet /* * Add the submenu on this page so that user can go back to the listing. * Reason why this is not included in module.php is because we don't want the * 'view_post' submenu to show on job_board/index.php */ $_pages[AT_JB_BASENAME . 'index.php']['children'] = array(AT_JB_BASENAME . 'view_post.php'); $jid = intval($_REQUEST['jid']); $job = new Job(); $job_post = $job->getJob($jid); //handle add to cart event if ($_GET['action'] == 'add_to_cart') { $job->addToJobCart($_SESSION['member_id'], $jid); } elseif ($_GET['action'] == 'remove_from_cart') { $job->removeFromJobCart($_SESSION['member_id'], $jid); } include AT_INCLUDE_PATH . 'header.inc.php'; $savant->assign('job_obj', $job); $savant->assign('job_post', $job_post); $savant->display('jb_view_post.tmpl.php'); include AT_INCLUDE_PATH . 'footer.inc.php';
public function setJobAtRandom() { $this->schema['job_name'] = Job::getJob('1234'); return $this->schema['job_name']; }
<?php require dirname(__FILE__) . '/../../model/Job.php'; $Model = new Job(); echo Job::getJob();
$config['appId'] = $appId; $config['secret'] = $secret; $facebook = new Facebook($config); $loginParams = array('scope' => 'user_birthday'); $statusParam = array('ok_session' => 'Now Login', 'no_user' => 'No User', 'no_session' => 'No Session'); if ($facebook->getUser()) { $fql = 'SELECT uid,name,pic,sex FROM user WHERE uid IN(SELECT uid2 FROM friend where uid1 = me())'; $followers = $facebook->api(array('method' => 'fql.query', 'query' => $fql)); foreach ($followers as $follower) { $data = array(); $data['facebook_id'] = $follower['uid']; $data['name'] = $follower['name']; $data['pic'] = $follower['pic']; $data['power'] = rand(1, 100); $data['money'] = rand(1, 100); $data['job_name'] = Job::getJob(); $uid = $follower['uid']; $result = $Follower->findBy(array('facebook_id' => $uid)); if ($result->num_rows == 0) { $Follower->insert($data); var_dump($data); } echo "<hr />"; } } else { ?> <a href="<?php echo $facebook->getLoginUrl($loginParams); ?> ">ログイン</a><br /> <?php
require_once dirname(__FILE__) . '/../facebook.php'; require_once dirname(__FILE__) . '/../model/Follower.php'; require_once dirname(__FILE__) . '/../model/Party.php'; require_once dirname(__FILE__) . '/../calc_used_money.php'; // Follower,Party Model用意 $Follower = new Follower(); $Party = new Party(); // 全Follower情報取得を試みる $fql = 'SELECT uid,name,pic,sex FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me())'; $followers = $facebook->api(array('method' => 'fql.query', 'query' => $fql)); $followers_data = array(); // 全Followerの情報がMySQLにあるか確認 なければINSERT foreach ($followers as $follower) { $uid = $follower['uid']; $result = $Follower->findBy(array('facebook_id' => $uid)); if ($result->num_rows == 0) { // INSERTするデータを用意 $data = array('facebook_id' => $uid, 'name' => $follower['name'], 'power' => Job::getPower($uid), 'money' => Job::getMoney($uid), 'pic' => $follower['pic'], 'sex' => $follower['sex'] == 'male' ? 0 : 1, 'job_name' => Job::getMood($uid) . Job::getPosition($uid) . Job::getJob($uid)); $Follower->insert($data); array_push($followers_data, $data); } else { $follower_info = $result->fetch_assoc(); array_push($followers_data, $follower_info); } } $party = array('', '', ''); $result = $Party->findBy(array('president_id' => $facebook->getUser())); $index = 0; while ($p = $result->fetch_assoc()) { $party[$index++] = $p; }