public function run()
 {
     $faker = Faker\Factory::create();
     foreach (range(1, 20) as $index) {
         Properties::create(['serialno' => '123abc', 'propname' => $faker->firstName, 'propdesc' => 'Lorem ipsum dolor sit amet', 'propstatus' => 'In stock', 'propcondition' => 'Good', 'prop_category' => $faker->numberBetween($min = 1, $max = 5), 'propcost' => $faker->randomFloat(NULL, 500, 35000), 'dateacq' => $faker->dateTimeBetween('-10 years', '-1 year')->format('Y-m-d')]);
     }
 }
 public function postAddProperty()
 {
     $validator = Validator::make(Input::all(), Properties::$rules, Properties::$errmsgs);
     if ($validator->fails()) {
         return Redirect::route('addproperty')->withErrors($validator)->withInput();
     }
     $prop = Properties::create(['serialno' => Input::get('serialno'), 'propname' => Input::get('propname'), 'propdesc' => Input::get('propdesc'), 'propcondition' => 'Good', 'propstatus' => 'In stock', 'prop_category' => Input::get('category'), 'propcost' => Input::get('propcost'), 'dateacq' => Input::get('dateacq')]);
     $lastid = Properties::orderBy('id', 'desc')->first();
     $audit = AuditTrail::create(['user_id' => Auth::id(), 'role' => 'Property Management Admin', 'action' => 'added a new property "' . $lastid->propname . '" with an ID of ' . $lastid->id . '.']);
     return Redirect::route('addproperty')->with('alert', 'success|Property has been successfully added.');
 }
Esempio n. 3
0
 /**
  * This test tries to load the keys of sectioned
  * property file.
  *
  * @return void
  */
 public function testGetKeysWithSections()
 {
     // initialize and load the stored property file
     $properties = Properties::create();
     $properties->load(__DIR__ . '/test.with.sections.properties', true);
     // load the keys
     $keys = $properties->getKeys();
     // check the expected keys
     $this->assertTrue(in_array('property.key.01', $keys));
     $this->assertTrue(in_array('property.key.02', $keys));
     $this->assertTrue(in_array('property.key.03', $keys));
     $this->assertTrue(in_array('property.key.04', $keys));
 }
Esempio n. 4
0
        }
    }
}
$core_names = array('courier' => 'Courier', 'courierB' => 'Courier-Bold', 'courierI' => 'Courier-Oblique', 'courierBI' => 'Courier-BoldOblique', 'helvetica' => 'Helvetica', 'helveticaB' => 'Helvetica-Bold', 'helveticaI' => 'Helvetica-Oblique', 'helveticaBI' => 'Helvetica-BoldOblique', 'times' => 'Times-Roman', 'timesB' => 'Times-Bold', 'timesI' => 'Times-Italic', 'timesBI' => 'Times-BoldItalic', 'symbol' => 'Symbol', 'zapfdingbats' => 'ZapfDingbats');
// Kommandozeilen-Parameter
$param = new ParamString($_SERVER['argv']);
$search = $param->exists('search') ? $param->value('search') : './src/font/.*';
$propertyFile = $param->exists('conf') ? $param->value('conf') : 'core_fonts.ini';
$pattern = basename($search);
$base = dirname($search);
printf("===> Start for %s [allfiles %s]\n", $base, $pattern);
$prop = new Properties($propertyFile);
if (!$prop->exists()) {
    try {
        printf("---> Creating configfile %s\n", $propertyFile);
        $prop->create();
    } catch (IOException $e) {
        $e->printStackTrace();
        exit;
    }
}
// Verzeichnis durchsuchen
$d = new Folder($base);
while ($e = $d->getEntry()) {
    if (is_dir($d->uri . '/' . $e) || !preg_match('/' . $pattern . '/', $e)) {
        continue;
    }
    printf("---> Saving fontdef for %s to %s\n", $e, $propertyFile);
    writeFontDef($d->uri . '/' . $e, $prop);
}
$d->close();