/** * @return obj */ public function show() { if (!isset(self::$_instance)) { $show = __CLASS__; self::$_instance = new $show(); } return self::$_instance; }
public function generate($field) { $rowset = App_Model_Show_Number::show()->getNumber(); $num = $rowset[$field]; $num = strval($num); $jumdigit = strlen($num); $kod = str_pad($num, $jumdigit, '0', STR_PAD_LEFT); return $kod; }
protected function generateKopel() { $rowset = App_Model_Show_Number::show()->getNumber(); $num = $rowset['user']; $totdigit = 5; $num = strval($num); $jumdigit = strlen($num); $kopel = str_repeat("0", $totdigit - $jumdigit) . $num; return $kopel; }
protected function generateKopel() { $rowset = App_Model_Show_Number::show()->getNumber(); $num = $rowset['user']; //$totdigit = 6; $num = strval($num); $jumdigit = strlen($num); //$kopel = str_repeat("0",$totdigit-$jumdigit).$num; $kopel = str_pad($num, $jumdigit, '0', STR_PAD_LEFT); return $kopel; }