public static function getNextInsertID($table, $hash = true, $append = "") { //---------------------------------------------------------- //init var //---------------------------------------------------------- $chk = array("bool" => true, 'result' => array(), "func" => "getHash"); //---------------------------------------------------------- $date = date("Y-m-d H:i:s"); //---------------------------------------------------------- $chk = GetTable::getLastID($table); //---------------------------------------------------------- if (!$chk['bool']) { $chk['bool'] = false; $chk['message'] = "getHash() returned NULL"; return $chk; } //---------------------------------------------------------- if ($chk['bool']) { $total = $chk['result']; } //---------------------------------------------------------- $insert_id = $total + 1; //---------------------------------------------------------- return $hash ? alphaID($insert_id . $date . $append) : alphaID($insert_id); }
private function getHash($table, $append = "") { //---------------------------------------------------------- //init var //---------------------------------------------------------- $chk = array("bool" => true, 'result' => array(), "func" => "toServer"); //---------------------------------------------------------- $date = date("Y-m-d H:i:s"); //---------------------------------------------------------- $chk = GetTable::getLastID($table); //---------------------------------------------------------- if (!$chk['bool']) { die($chk); } else { $total = $chk['result']; } //---------------------------------------------------------- return alphaID($total + 1 . $date . $append); }