本文整理汇总了PHP中TTDate::getDBTimeStamp方法的典型用法代码示例。如果您正苦于以下问题:PHP TTDate::getDBTimeStamp方法的具体用法?PHP TTDate::getDBTimeStamp怎么用?PHP TTDate::getDBTimeStamp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TTDate
的用法示例。
在下文中一共展示了TTDate::getDBTimeStamp方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _outputPDFForm
function _outputPDFForm($format = NULL)
{
$show_background = TRUE;
if ($format == 'pdf_form_print' or $format == 'pdf_form_print_government' or $format == 'efile') {
$show_background = FALSE;
}
Debug::Text('Generating Form... Format: ' . $format, __FILE__, __LINE__, __METHOD__, 10);
$setup_data = $this->getFormConfig();
$filter_data = $this->getFilterConfig();
//Debug::Arr($filter_data, 'Filter Data: ', __FILE__, __LINE__, __METHOD__,10);
$current_company = $this->getUserObject()->getCompanyObject();
if (!is_object($current_company)) {
Debug::Text('Invalid company object...', __FILE__, __LINE__, __METHOD__, 10);
return FALSE;
}
$current_user = $this->getUserObject();
if (!is_object($current_user)) {
Debug::Text('Invalid user object...', __FILE__, __LINE__, __METHOD__, 10);
return FALSE;
}
if ($format == 'efile_xml') {
$return1040 = $this->getRETURN1040Object();
// Ceate the all needed data for Return1040.xsd at here.
$return1040->return_created_timestamp = TTDate::getDBTimeStamp(TTDate::getTime(), FALSE);
$return1040->year = TTDate::getYear($filter_data['end_date']);
$return1040->tax_period_begin_date = TTDate::getDate('Y-m-d', TTDate::getBeginDayEpoch($filter_data['start_date']));
$return1040->tax_period_end__date = TTDate::getDate('Y-m-d', TTDate::getEndDayEpoch($filter_data['end_date']));
$return1040->software_id = '';
$return1040->originator_efin = '';
$return1040->originator_type_code = '';
$return1040->pin_type_code = '';
$return1040->jurat_disclosure_code = '';
$return1040->pin_entered_by = '';
$return1040->signature_date = TTDate::getDate('Y-m-d', TTDate::getTime());
$return1040->return_type = '';
$return1040->ssn = '';
$return1040->name = (isset($setup_data['company_name']) and $setup_data['company_name'] != '') ? $setup_data['company_name'] : $current_company->getName();
$return1040->name_control = '';
$return1040->address1 = (isset($setup_data['address1']) and $setup_data['address1'] != '') ? $setup_data['address1'] : $current_company->getAddress1() . ' ' . $current_company->getAddress2();
$return1040->city = (isset($setup_data['city']) and $setup_data['city'] != '') ? $setup_data['city'] : $current_company->getCity();
$return1040->state = (isset($setup_data['province']) and ($setup_data['province'] != '' and $setup_data['province'] != 0)) ? $setup_data['province'] : $current_company->getProvince();
$return1040->zip_code = (isset($setup_data['postal_code']) and $setup_data['postal_code'] != '') ? $setup_data['postal_code'] : $current_company->getPostalCode();
$return1040->ip_address = '';
$return1040->ip_date = TTDate::getDate('Y-m-d', TTDate::getTime());
$return1040->ip_time = TTDate::getDate('H:i:s', TTDate::getTime());
$return1040->timezone = TTDate::getTimeZone();
$this->getFormObject()->addForm($return1040);
}
$this->sortFormData();
//Make sure forms are sorted.
$fw2 = $this->getFW2Object();
$fw2->setDebug(FALSE);
//if ( $format == 'efile' ) {
// $fw2->setDebug(TRUE);
//}
$fw2->setShowBackground($show_background);
if (stristr($format, 'government')) {
$form_type = 'government';
} else {
$form_type = 'employee';
}
Debug::Text('Form Type: ' . $form_type, __FILE__, __LINE__, __METHOD__, 10);
$fw2->setType($form_type);
$fw2->year = TTDate::getYear($filter_data['end_date']);
//Add support for the user to manually set this data in the setup_data. That way they can use multiple tax IDs for different employees, all beit manually.
$fw2->ein = (isset($setup_data['ein']) and $setup_data['ein'] != '') ? $setup_data['ein'] : $current_company->getBusinessNumber();
$fw2->name = (isset($setup_data['name']) and $setup_data['name'] != '') ? $setup_data['name'] : $this->getUserObject()->getFullName();
$fw2->trade_name = (isset($setup_data['company_name']) and $setup_data['company_name'] != '') ? $setup_data['company_name'] : $current_company->getName();
$fw2->company_address1 = (isset($setup_data['address1']) and $setup_data['address1'] != '') ? $setup_data['address1'] : $current_company->getAddress1() . ' ' . $current_company->getAddress2();
$fw2->company_city = (isset($setup_data['city']) and $setup_data['city'] != '') ? $setup_data['city'] : $current_company->getCity();
$fw2->company_state = (isset($setup_data['province']) and ($setup_data['province'] != '' and $setup_data['province'] != 0)) ? $setup_data['province'] : $current_company->getProvince();
$fw2->company_zip_code = (isset($setup_data['postal_code']) and $setup_data['postal_code'] != '') ? $setup_data['postal_code'] : $current_company->getPostalCode();
$fw2->efile_user_id = (isset($setup_data['efile_user_id']) and $setup_data['efile_user_id'] != '') ? $setup_data['efile_user_id'] : NULL;
$fw2->efile_state = (isset($setup_data['efile_state']) and $setup_data['efile_state'] != '') ? $setup_data['efile_state'] : 0;
$fw2->contact_name = $current_user->getFullName();
$fw2->contact_phone = $current_user->getWorkPhone();
$fw2->contact_phone_ext = $current_user->getWorkPhoneExt();
$fw2->contact_email = $current_user->getWorkEmail();
if (isset($this->form_data) and count($this->form_data) > 0) {
$i = 0;
$n = 1;
foreach ((array) $this->form_data as $row) {
if (!isset($row['user_id'])) {
Debug::Text('User ID not set!', __FILE__, __LINE__, __METHOD__, 10);
continue;
}
$ulf = TTnew('UserListFactory');
$ulf->getById((int) $row['user_id']);
if ($ulf->getRecordCount() == 1) {
$user_obj = $ulf->getCurrent();
$ee_data = array('control_number' => $n, 'first_name' => $user_obj->getFirstName(), 'middle_name' => $user_obj->getMiddleName(), 'last_name' => $user_obj->getLastName(), 'address1' => $user_obj->getAddress1(), 'address2' => $user_obj->getAddress2(), 'city' => $user_obj->getCity(), 'state' => $user_obj->getProvince(), 'employment_province' => $user_obj->getProvince(), 'zip_code' => $user_obj->getPostalCode(), 'ssn' => $user_obj->getSIN(), 'employee_number' => $user_obj->getEmployeeNumber(), 'l1' => $row['l1'], 'l2' => $row['l2'], 'l3' => $row['l3'], 'l4' => $row['l4'], 'l5' => $row['l5'], 'l6' => $row['l6'], 'l7' => $row['l7'], 'l8' => $row['l8'], 'l10' => $row['l10'], 'l11' => $row['l11'], 'l12a_code' => NULL, 'l12a' => NULL, 'l12b_code' => NULL, 'l12b' => NULL, 'l12c_code' => NULL, 'l12c' => NULL, 'l12d_code' => NULL, 'l12d' => NULL, 'l14a_name' => NULL, 'l14a' => NULL, 'l14b_name' => NULL, 'l14b' => NULL, 'l14c_name' => NULL, 'l14c' => NULL, 'l14d_name' => NULL, 'l14d' => NULL);
if ($row['l12a'] > 0 and isset($setup_data['l12a_code']) and $setup_data['l12a_code'] != '') {
$ee_data['l12a_code'] = $setup_data['l12a_code'];
$ee_data['l12a'] = $row['l12a'];
}
if ($row['l12b'] > 0 and isset($setup_data['l12b_code']) and $setup_data['l12b_code'] != '') {
$ee_data['l12b_code'] = $setup_data['l12b_code'];
$ee_data['l12b'] = $row['l12b'];
}
if ($row['l12c'] > 0 and isset($setup_data['l12c_code']) and $setup_data['l12c_code'] != '') {
//.........这里部分代码省略.........
示例2: setTransactionDate
function setTransactionDate($epoch)
{
$epoch = trim($epoch);
if ($this->Validator->isDate('transaction_date', $epoch, TTi18n::gettext('Incorrect transaction date'))) {
$this->data['transaction_date'] = TTDate::getDBTimeStamp($epoch, FALSE);
return TRUE;
}
return FALSE;
}
示例3: getPunchData
function getPunchData()
{
if ($this->StationCheckAllowed() !== TRUE) {
Debug::text('Station NOT allowed: ', __FILE__, __LINE__, __METHOD__, 10);
return FALSE;
}
$epoch = TTDate::getTime();
$slf = new ScheduleListFactory();
//Get last punch for this day, for this user.
$plf = new PunchListFactory();
$plf->getPreviousPunchByUserIDAndEpoch($this->getUserObject()->getId(), $epoch);
if ($plf->getRecordCount() > 0) {
$prev_punch_obj = $plf->getCurrent();
Debug::Text(' Found Previous Punch within Continuous Time from now, ID: ' . $prev_punch_obj->getId(), __FILE__, __LINE__, __METHOD__, 10);
$branch_id = $prev_punch_obj->getPunchControlObject()->getBranch();
$department_id = $prev_punch_obj->getPunchControlObject()->getDepartment();
$job_id = $prev_punch_obj->getPunchControlObject()->getJob();
$job_item_id = $prev_punch_obj->getPunchControlObject()->getJobItem();
//Don't enable transfer by default if the previous punch was any OUT punch.
//Transfer does the OUT punch for them, so if the previous punch is an OUT punch
//we don't gain anything anyways.
if ($this->getPermissionObject()->Check('punch', 'default_transfer') and $prev_punch_obj->getStatus() == 10) {
$transfer = TRUE;
} else {
$transfer = FALSE;
}
if ($branch_id == '' or empty($branch_id) or $department_id == '' or empty($department_id) or $job_id == '' or empty($job_id) or $job_item_id == '' or empty($job_item_id)) {
Debug::Text(' Branch or department are null. ', __FILE__, __LINE__, __METHOD__, 10);
$s_obj = $slf->getScheduleObjectByUserIdAndEpoch($this->getUserObject()->getId(), $epoch);
if (is_object($s_obj)) {
Debug::Text(' Found Schedule!: ', __FILE__, __LINE__, __METHOD__, 10);
if ($branch_id == '' or empty($branch_id)) {
Debug::Text(' overrriding branch: ' . $s_obj->getBranch(), __FILE__, __LINE__, __METHOD__, 10);
$branch_id = $s_obj->getBranch();
}
if ($department_id == '' or empty($department_id)) {
Debug::Text(' overrriding department: ' . $s_obj->getDepartment(), __FILE__, __LINE__, __METHOD__, 10);
$department_id = $s_obj->getDepartment();
}
if ($job_id == '' or empty($job_id)) {
Debug::Text(' overrriding job: ' . $s_obj->getJob(), __FILE__, __LINE__, __METHOD__, 10);
$job_id = $s_obj->getJob();
}
if ($job_item_id == '' or empty($job_item_id)) {
Debug::Text(' overrriding job item: ' . $s_obj->getJobItem(), __FILE__, __LINE__, __METHOD__, 10);
$job_item_id = $s_obj->getJobItem();
}
}
}
$next_type = $prev_punch_obj->getNextType();
//Check for break policy window.
if ($next_type != 30 and ($prev_punch_obj->getStatus() != 30 and $prev_punch_obj->getType() != 30)) {
$prev_punch_obj->setUser($this->getUserObject()->getId());
$prev_punch_obj->setScheduleID($prev_punch_obj->findScheduleID($epoch));
if ($prev_punch_obj->inBreakPolicyWindow($epoch, $prev_punch_obj->getTimeStamp()) == TRUE) {
Debug::Text(' Setting Type to Break: ', __FILE__, __LINE__, __METHOD__, 10);
$next_type = 30;
}
}
//Check for meal policy window.
if ($next_type != 20 and ($prev_punch_obj->getStatus() != 20 and $prev_punch_obj->getType() != 20)) {
$prev_punch_obj->setUser($this->getUserObject()->getId());
$prev_punch_obj->setScheduleID($prev_punch_obj->findScheduleID($epoch));
if ($prev_punch_obj->inMealPolicyWindow($epoch, $prev_punch_obj->getTimeStamp()) == TRUE) {
Debug::Text(' Setting Type to Lunch: ', __FILE__, __LINE__, __METHOD__, 10);
$next_type = 20;
}
}
Debug::Text(' cJob Item ID: ' . $job_item_id, __FILE__, __LINE__, __METHOD__, 10);
$note = '';
if ((int) $prev_punch_obj->getNextStatus() == 20) {
$note = $prev_punch_obj->getPunchControlObject()->getNote();
}
$data = array('user_id' => (int) $this->getUserObject()->getId(), 'user_full_name' => $this->getUserObject()->getFullName(), 'time_stamp' => TTDate::getDate('TIME', $epoch), 'date_stamp' => TTDate::getDate('DATE', $epoch), 'full_time_stamp' => $epoch, 'iso_time_stamp' => TTDate::getDBTimeStamp($epoch, FALSE), 'transfer' => $transfer, 'branch_id' => (int) $branch_id, 'department_id' => (int) $department_id, 'job_id' => $job_id, 'job_item_id' => $job_item_id, 'quantity' => $prev_punch_obj->getPunchControlObject()->getQuantity(), 'bad_quantity' => $prev_punch_obj->getPunchControlObject()->getBadQuantity(), 'note' => (string) $note, 'other_id1' => $prev_punch_obj->getPunchControlObject()->getOtherID1(), 'other_id2' => $prev_punch_obj->getPunchControlObject()->getOtherID2(), 'other_id3' => $prev_punch_obj->getPunchControlObject()->getOtherID3(), 'other_id4' => $prev_punch_obj->getPunchControlObject()->getOtherID4(), 'other_id5' => $prev_punch_obj->getPunchControlObject()->getOtherID5(), 'status_id' => (int) $prev_punch_obj->getNextStatus(), 'type_id' => (int) $next_type, 'punch_control_id' => (int) $prev_punch_obj->getNextPunchControlID());
unset($note);
} else {
Debug::Text(' DID NOT Find Previous Punch within Continuous Time from now: ', __FILE__, __LINE__, __METHOD__, 10);
//These used to be NULLs, but as of TT v3.0 they cause deserilizer errors with a Java client.
$branch_id = '';
$department_id = '';
$job_id = '';
$job_item_id = '';
$s_obj = $slf->getScheduleObjectByUserIdAndEpoch($this->getUserObject()->getId(), $epoch);
if (is_object($s_obj)) {
Debug::Text(' Found Schedule! ID:' . $s_obj->getID() . ' Job ID: ' . $s_obj->getJob(), __FILE__, __LINE__, __METHOD__, 10);
$branch_id = $s_obj->getBranch();
$department_id = $s_obj->getDepartment();
$job_id = $s_obj->getJob();
$job_item_id = $s_obj->getJobItem();
} else {
//Check for defaults
$branch_id = $this->getUserObject()->getDefaultBranch();
$department_id = $this->getUserObject()->getDefaultDepartment();
//Check station for default/forced settings.
if (is_object($this->getStationObject())) {
if ($this->getStationObject()->getDefaultBranch() !== FALSE and $this->getStationObject()->getDefaultBranch() != 0) {
$branch_id = $this->getStationObject()->getDefaultBranch();
}
if ($this->getStationObject()->getDefaultDepartment() !== FALSE and $this->getStationObject()->getDefaultDepartment() != 0) {
$department_id = $this->getStationObject()->getDefaultDepartment();
//.........这里部分代码省略.........
示例4: dateTest
function dateTest($test = 1)
{
switch ($test) {
case 1:
$retarr = array(strtotime('30-Oct-09 5:00PM') => TTDate::getDBTimeStamp(strtotime('30-Oct-09 5:00PM')), strtotime('31-Oct-09 5:00PM') => TTDate::getDBTimeStamp(strtotime('31-Oct-09 5:00PM')), strtotime('01-Nov-09 5:00PM') => TTDate::getDBTimeStamp(strtotime('01-Nov-09 5:00PM')), strtotime('02-Nov-09 5:00PM') => TTDate::getDBTimeStamp(strtotime('02-Nov-09 5:00PM')));
break;
case 2:
$retarr = array(strtotime('30-Oct-09 5:00PM') => TTDate::getFlexTimeStamp(strtotime('30-Oct-09 5:00PM')), strtotime('31-Oct-09 5:00PM') => TTDate::getFlexTimeStamp(strtotime('31-Oct-09 5:00PM')), strtotime('01-Nov-09 5:00PM') => TTDate::getFlexTimeStamp(strtotime('01-Nov-09 5:00PM')), strtotime('02-Nov-09 5:00PM') => TTDate::getFlexTimeStamp(strtotime('02-Nov-09 5:00PM')));
break;
}
return $retarr;
}
示例5: setTransactionDate
function setTransactionDate($epoch)
{
$epoch = trim($epoch);
if ($epoch != '') {
//Make sure all pay periods transact at noon.
$epoch = TTDate::getTimeLockedDate(strtotime('12:00:00', $epoch), $epoch);
//Unless they are on the same date as the end date, then it should match that.
if ($this->getEndDate() != '' and $this->getEndDate() > $epoch) {
$epoch = $this->getEndDate();
}
}
if ($this->Validator->isDate('transaction_date', $epoch, TTi18n::gettext('Incorrect transaction date'))) {
$this->data['transaction_date'] = TTDate::getDBTimeStamp($epoch, FALSE);
return TRUE;
}
return FALSE;
}