本文整理汇总了PHP中fix_date函数的典型用法代码示例。如果您正苦于以下问题:PHP fix_date函数的具体用法?PHP fix_date怎么用?PHP fix_date使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fix_date函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: summary_report
public function summary_report()
{
$users = array();
if (isModuleAdmin()) {
$u = DataObjectFactory::Factory('User');
$users = $u->getAll();
}
$this->view->set('users', $users);
if (isset($this->_data['filter'])) {
$cc = new ConstraintChain();
if (!empty($this->_data['from_date'])) {
$cc->add(new Constraint('enddate', '>', fix_date($this->_data['from_date'])));
}
if (!empty($this->_data['to_date'])) {
$cc->add(new Constraint('enddate', '<', fix_date($this->_data['to_date'])));
}
if (!isModuleAdmin()) {
$cc->add(new Constraint('assigned', '=' . EGS_USERNAME));
} elseif (!empty($this->_data['assigned'])) {
$cc->add(new Constraint('assigned', '=', $this->_data['assigned']));
}
$opp_sh = new SearchHandler(new OpportunityCollection($this->_templateobject), false);
$opp_sh->addConstraintChain($cc);
$opp_sh->extract();
$os = DataObjectFactory::Factory('Opportunitystatus');
$os->addSearchHandler('opportunities', $opp_sh);
$statuses = new OpportunitystatusCollection($os);
$sh = new SearchHandler($statuses, false);
$sh->extract();
$statuses->load($sh);
$this->view->set('statuses', $statuses);
$this->view->set('report_headings', array('name', 'company', 'person', 'enddate', 'type', 'cost', 'assigned'));
$this->view->set('cc', $cc);
}
}
开发者ID:uzerpllp,项目名称:uzerp,代码行数:35,代码来源:OpportunitysController.php
示例2: revalue
function revalue($data, &$errors = array())
{
if (empty($data['transaction_date'])) {
$data['transaction_date'] = date(DATE_FORMAT);
}
$glperiod = GLPeriod::getPeriod(fix_date($data['transaction_date']));
if (!$glperiod || count($glperiod) == 0) {
$errors[] = 'No period exists for this date';
return false;
}
$data['value'] = bcsub($this->glbalance(), $data['new_balance']);
$data['glperiods_id'] = $glperiod['id'];
$data['source'] = 'C';
$data['type'] = 'V';
$data['glaccount_id'] = $this->currency_detail->writeoff_glaccount_id;
$data['glcentre_id'] = $this->currency_detail->glcentre_id;
GLTransaction::setTwinCurrency($data);
$gl_trans[] = GLTransaction::Factory($data, $errors);
$data['value'] = bcmul($data['value'], -1);
$data['glaccount_id'] = $this->glaccount_id;
$data['glcentre_id'] = $this->glcentre_id;
GLTransaction::setTwinCurrency($data);
$gl_trans[] = GLTransaction::Factory($data, $errors);
$db = DB::Instance();
$db->StartTrans();
if (count($errors) == 0 && GLTransaction::saveTransactions($gl_trans, $errors)) {
return $db->CompleteTrans();
}
$errors[] = 'Failed to save GL Transaction';
$db->FailTrans();
$db->CompleteTrans();
return false;
}
开发者ID:uzerpllp,项目名称:uzerp,代码行数:33,代码来源:CBAccount.php
示例3: index
public function index()
{
$this->view->set('clickaction', 'view');
$s_data = array();
// Set context from calling module
if (isset($this->_data['slmaster_id'])) {
$s_data['slmaster_id'] = $this->_data['slmaster_id'];
}
if (isset($this->_data['status'])) {
$s_data['status'] = $this->_data['status'];
}
$this->setSearch('sltransactionsSearch', 'useDefault', $s_data);
$transaction_date = $this->search->getValue('transaction_date');
if (isset($transaction_date['from'])) {
$from_date = fix_date($transaction_date['from']);
} else {
$from_date = '';
}
if (isset($transaction_date['to'])) {
$to_date = fix_date($transaction_date['to']);
} else {
$to_date = '';
}
parent::index(new SLTransactionCollection($this->_templateobject));
$this->view->set('search', $s_data);
}
开发者ID:uzerpllp,项目名称:uzerp,代码行数:26,代码来源:SltransactionsController.php
示例4: save
public function save()
{
$flash = Flash::Instance();
$errors = array();
$data = $this->_data[$this->modeltype];
$obj = '';
if (!empty($data['task_id'])) {
$obj = new Task();
$obj->load($data['task_id']);
} elseif (!empty($data['project_id'])) {
$obj = new Project();
$obj->load($data['project_id']);
}
if ($obj instanceof DataObject && $obj->isLoaded()) {
if (fix_date($data['start_date']) < $obj->start_date) {
$errors['start_date'] = 'Start date before ' . get_class($obj) . ' start date';
}
if (fix_date($data['end_date']) > $obj->end_date) {
$errors['end_date'] = 'End date after ' . get_class($obj) . ' end date';
}
}
if (!empty($data['person_id']) && $data['quantity'] > 1) {
$errors['person_id'] = 'Quantity must be 1 for a person';
}
if (count($errors) == 0 && parent::save($this->modeltype, '', $errors)) {
sendBack();
} else {
$flash->addErrors($errors);
$this->refresh();
}
}
开发者ID:uzerpllp,项目名称:uzerp,代码行数:31,代码来源:ResourcesController.php
示例5: getRemittance
function getRemittance(&$_data = array(), &$model = array(), &$extra = array(), &$errors = array())
{
// load the model
$supplier = DataObjectFactory::Factory('PLSupplier');
$supplier->load($this->plmaster_id);
$_data['email_subject'] = $supplier->name . ' Remittance ' . $this->transaction_date;
$_data['filename'] = 'Remittance-' . $this->id;
// get the payment method
$plpayment = DataObjectFactory::Factory('PLPayment');
$plpayment->load($this->cross_ref);
// get the remittance list
$pltransactions = new PLAllocationCollection(DataObjectFactory::Factory('PLAllocation'));
$pltransactions->remittanceList($this->id);
$model = array($supplier, $pltransactions);
// set date
// a bit messy nesting in so many functions
$extra['date'] = un_fix_date(fix_date(date(DATE_FORMAT)));
// set company name
$company = DataObjectFactory::Factory('Company');
$company->load(COMPANY_ID);
$extra['company_name'] = $company->name;
// set company address
$company_address = array('name' => $company->name);
$output = array();
$parts = array("street1", "street2", "street3", "town", "county", "postcode", "country");
$address = $company->getAddress();
foreach ($parts as $part) {
if (!is_null($address->{$part})) {
$output[$part] = $address->{$part};
}
}
$company_address += $output;
$extra['company_address'] = $company_address;
// set the company details
$email = $company->getContactDetail('E', 'REMITTANCE');
if (empty($email)) {
$email = $company->getContactDetail('E');
}
$_data['replyto'] = $email;
$extra['company_details'] = array('tel' => 'Tel: ' . $company->getContactDetail('T'), 'fax' => 'Fax: ' . $company->getContactDetail('F'), 'email' => 'Email: ' . $email, 'vat_number' => 'VAT Number: ' . $company->vatnumber, 'company_number' => 'Company Number: ' . $company->companynumber);
// set supplier address
$supplier_address = array('name' => $supplier->name);
$output = array();
$parts = array("street1", "street2", "street3", "town", "county", "postcode", "country");
$address = $supplier->getBillingAddress();
foreach ($parts as $part) {
if (!is_null($address->{$part})) {
$output[$part] = $address->{$part};
}
}
$supplier_address += $output;
$extra['supplier_address'] = $supplier_address;
// set document details
$document_reference = array();
$document_reference[]['line'] = array('label' => 'Payment Date', 'value' => un_fix_date($this->transaction_date));
$document_reference[]['line'] = array('label' => 'Payment Value', 'value' => bcmul($this->gross_value, -1, 2));
$document_reference[]['line'] = array('label' => 'Currency', 'value' => $plpayment->currency);
$document_reference[]['line'] = array('label' => 'Payment Method', 'value' => $plpayment->payment_type);
$extra['document_reference'] = $document_reference;
}
开发者ID:uzerpllp,项目名称:uzerp,代码行数:60,代码来源:PLTransaction.php
示例6: copyStructure
function copyStructure($data, &$errors)
{
$mfstructures = new MFStructureCollection(DataObjectFactory::Factory('MFStructure'));
$cc1 = new ConstraintChain();
$cc1->add(new Constraint('stitem_id', '=', $data->stitem_id));
$cc1->add(new Constraint('start_date', '<=', fix_date(date(DATE_FORMAT))));
$cc2 = new ConstraintChain();
$cc2->add(new Constraint('end_date', '>=', fix_date(date(DATE_FORMAT))));
$cc2->add(new Constraint('end_date', 'is', 'NULL'), 'OR');
$sh = new SearchHandler($mfstructures, false);
$sh->addConstraintChain($cc1);
$sh->addConstraintChain($cc2);
$mfstructures->load($sh);
$wo_structure = array();
$wo_structures = array();
$copyfields = array('line_no', 'qty', 'uom_id', 'remarks', 'waste_pc', 'ststructure_id');
foreach ($mfstructures as $input) {
$wo_structure['work_order_id'] = $data->id;
foreach ($copyfields as $field) {
$wo_structure[$field] = $input->{$field};
}
$wo_structures[$input->line_no] = DataObject::Factory($wo_structure, $errors, 'MFWOStructure');
}
return $wo_structures;
}
开发者ID:uzerpllp,项目名称:uzerp,代码行数:25,代码来源:MFWOStructure.php
示例7: Factory
public static function Factory($data, &$errors = array(), $do_name = null)
{
if (empty($data['calendar_week'])) {
$data['calendar_week'] = date('W', strtotime(fix_date($data['period_start_date'], DATE_TIME_FORMAT, $errors)));
}
return parent::Factory($data, $errors, $do_name);
}
开发者ID:uzerpllp,项目名称:uzerp,代码行数:7,代码来源:EmployeePayPeriod.php
示例8: makeHeader
public static function makeHeader($data, $do, &$errors)
{
if (strtotime(fix_date($data['order_date'])) > strtotime(fix_date(date(DATE_FORMAT)))) {
$errors[] = 'Order Date cannot be in the future';
return false;
}
if (!isset($data['id']) || $data['id'] == '') {
// $generator = new OrderNumberHandler();
$generator = new UniqueNumberHandler(false, $data['type'] != 'T');
$data['order_number'] = $generator->handle(DataObjectFactory::Factory($do));
$data['status'] = 'N';
$user = getCurrentUser();
$data['raised_by'] = $user->username;
}
//determine the base currency
$currency = DataObjectFactory::Factory('Currency');
$currency->load($data['currency_id']);
$data['rate'] = $currency->rate;
//determine the twin currency
$glparams = DataObjectFactory::Factory('GLParams');
$twin_currency = DataObjectFactory::Factory('Currency');
$twin_currency->load($glparams->base_currency());
$data['twin_rate'] = $twin_currency->rate;
$data['twin_currency_id'] = $twin_currency->id;
return DataObject::Factory($data, $errors, $do);
}
开发者ID:uzerpllp,项目名称:uzerp,代码行数:26,代码来源:SPOrder.php
示例9: loadPeriod
public function loadPeriod($date)
{
// Loads the period in which the supplied date falls
$subquery = "(SELECT min(enddate) \r\n\t\t\t\t FROM gl_periods z\r\n\t\t\t\t WHERE z.enddate >= '" . fix_date($date) . "' AND z.usercompanyid = " . EGS_COMPANY_ID . ")";
$cc = new ConstraintChain();
$cc->add(new Constraint('enddate', '=', $subquery));
return $this->loadBy($cc);
}
开发者ID:uzerpllp,项目名称:uzerp,代码行数:8,代码来源:GLPeriod.php
示例10: getCurrent
function getCurrent($cc = null)
{
if (!$cc instanceof ConstraintChain) {
$cc = new ConstraintChain();
}
$cc1 = new ConstraintChain();
$cc1->add(new Constraint('end_date', 'is', 'NULL'));
$cc1->add(new Constraint('end_date', '>', fix_date(date(DATE_FORMAT))), 'OR');
$cc->add($cc1);
}
开发者ID:uzerpllp,项目名称:uzerp,代码行数:10,代码来源:Person.php
示例11: populate
function populate()
{
$pp = new PeriodicPaymentCollection();
$pl = new PageList('overdue_periodic_payments');
$sh = new SearchHandler($pp, false);
$sh->addConstraint(new Constraint('status', '=', "('A')"));
$sh->addConstraint(new Constraint('next_due_date', '<=', fix_date(date(DATE_FORMAT))));
$this->setSearchLimit($sh);
$sh->setOrderBy('next_due_date');
$pp->load($sh);
$this->contents = $pp;
}
开发者ID:uzerpllp,项目名称:uzerp,代码行数:12,代码来源:PPOverdueEGlet.php
示例12: validate
public function validate($_value, &$errors = array())
{
switch ($this->data_type) {
case 'date':
$date = fix_date($_value, $this->external_format, $errors);
if ($date === false) {
return $_value;
}
return un_fix_date($date);
break;
}
}
开发者ID:uzerpllp,项目名称:uzerp,代码行数:12,代码来源:DataMappingRule.php
示例13: get_week_dates
public function get_week_dates(&$errors = array())
{
if (!$this->isLoaded()) {
$this->loadBy('usercompanyid', EGS_COMPANY_ID);
}
if (!$this->isLoaded()) {
$errors[] = 'Cannot find HR Parameters';
return FALSE;
}
$dates['week_start_date'] = fix_date(date(DATE_FORMAT, strtotime('last ' . $this->week_start_day))) . ' ' . $this->week_start_time . ':00';
$dates['week_end_date'] = fix_date(date(DATE_FORMAT, strtotime($dates['week_start_date'] . ' + 7day'))) . ' ' . $this->week_start_time . ':00';
return $dates;
}
开发者ID:uzerpllp,项目名称:uzerp,代码行数:13,代码来源:HRParameters.php
示例14: populate
function populate()
{
$pl = new PageList('companies_added_today');
$companies_do = new CompanyCollection(new Company());
$sh = new SearchHandler($companies_do, false);
$sh->extract();
$sh->addConstraint(new Constraint('is_lead', '=', 'false'));
$sh->addConstraint(new Constraint('created', '>', fix_date(date(DATE_FORMAT))));
$sh->setLimit(10);
$companies_do->load($sh);
$pl->addFromCollection($companies_do, array('module' => 'contacts', 'controller' => 'companys', 'action' => 'view'), array('id'), 'company', 'name');
$this->contents = $pl->getPages()->toArray();
}
开发者ID:uzerpllp,项目名称:uzerp,代码行数:13,代码来源:CompaniesAddedTodayEGlet.php
示例15: populate
function populate()
{
$orders = new POrderLineCollection();
$orders->setParams();
$sh = new SearchHandler($orders, false);
$sh->addConstraint(new Constraint('status', 'in', "('A','P')"));
$sh->addConstraint(new Constraint('order_status', '!=', "X"));
$sh->addConstraint(new Constraint('due_delivery_date', '<', fix_date(date(DATE_FORMAT))));
$this->setSearchLimit($sh);
$sh->setOrderBy(array('due_delivery_date', 'id'));
$orders->load($sh);
$this->contents = $orders;
}
开发者ID:uzerpllp,项目名称:uzerp,代码行数:13,代码来源:POrdersOverdueEGlet.php
示例16: getItems
public function getItems()
{
$mfoperation = DataObjectFactory::Factory('MFOperation');
$cc = new ConstraintChain();
$cc->add(new Constraint('mfcentre_id', '=', $this->mf_centre_id));
$cc->add(new Constraint('obsolete_date', 'is', 'NULL'));
$cc1 = new ConstraintChain();
$cc1->add(new Constraint('end_date', '>', fix_date(date(DATE_FORMAT))));
$cc1->add(new Constraint('end_date', 'is', 'NULL'), 'OR');
$cc->add($cc1);
$mfoperation->idField = 'stitem_id';
$mfoperation->identifierField = 'stitem';
$mfoperation->orderby = 'stitem';
return $mfoperation->getAll($cc, TRUE, TRUE);
}
开发者ID:uzerpllp,项目名称:uzerp,代码行数:15,代码来源:MFShift.php
示例17: Factory
static function Factory($data, &$errors, $do_name = __CLASS__)
{
$do = DataObjectFactory::Factory($do_name);
$db = DB::Instance();
if (empty($data['docref'])) {
$data['docref'] = $db->GenID('gl_transactions_docref_seq');
}
$glperiod = GLPeriod::getPeriod(fix_date($data['transaction_date']));
if (!$glperiod || count($glperiod) == 0) {
$errors[] = 'No period exists for this date';
}
$data['glperiods_id'] = $glperiod['id'];
$data['status'] = $do->newStatus();
return parent::Factory($data, $errors, $do);
}
开发者ID:uzerpllp,项目名称:uzerp,代码行数:15,代码来源:GLTransactionHeader.php
示例18: populate
function populate()
{
$pl = new PageList('top_sales_orders');
$today = fix_date(date(DATE_FORMAT));
$weekend = fix_date(date(DATE_FORMAT, strtotime("next Monday", strtotime($today)) - 1));
$startdate = fix_date('01/' . date('m/Y'));
$monthend = fix_date(date(DATE_FORMAT, strtotime("+1 months", strtotime($startdate)) - 1));
$nextmonth = fix_date(date(DATE_FORMAT, strtotime("+2 months", strtotime($startdate)) - 1));
$orderline = DataObjectFactory::Factory('SOrderLine');
$db =& DB::Instance();
// Get overdue orders
$cc = new ConstraintChain();
$cc->add(new Constraint('type', '=', $this->params['type']));
$cc->add(new Constraint('status', 'in', "('N', 'R', 'S')"));
$cc->add(new Constraint('due_despatch_date', '<', $db->qstr($today)));
$customersales['Overdue'] = $orderline->getSum('base_net_value', $cc, 'so_linesoverview');
// Get orders due today
$cc = new ConstraintChain();
$cc->add(new Constraint('type', '=', $this->params['type']));
$cc->add(new Constraint('status', 'in', "('N', 'R', 'S')"));
$cc->add(new Constraint('due_despatch_date', '=', $db->qstr($today)));
$customersales['Today'] = $orderline->getSum('base_net_value', $cc, 'so_linesoverview');
// Get orders due this week
$cc = new ConstraintChain();
$cc->add(new Constraint('type', '=', $this->params['type']));
$cc->add(new Constraint('status', 'in', "('N', 'R', 'S')"));
$cc->add(new Constraint('due_despatch_date', '>', $db->qstr($today)));
$cc->add(new Constraint('due_despatch_date', '<=', $db->qstr($weekend)));
$customersales['This Week'] = $orderline->getSum('base_net_value', $cc, 'so_linesoverview');
// Get orders due this month
$cc = new ConstraintChain();
$cc->add(new Constraint('type', '=', $this->params['type']));
$cc->add(new Constraint('status', 'in', "('N', 'R', 'S')"));
$cc->add(new Constraint('due_despatch_date', '>', $db->qstr($weekend)));
$cc->add(new Constraint('due_despatch_date', '<=', $db->qstr($monthend)));
$customersales['This Month'] = $orderline->getSum('base_net_value', $cc, 'so_linesoverview');
// Get orders due next month
$cc = new ConstraintChain();
$cc->add(new Constraint('type', '=', $this->params['type']));
$cc->add(new Constraint('status', 'in', "('N', 'R', 'S')"));
$cc->add(new Constraint('due_despatch_date', '>', $db->qstr($monthend)));
$cc->add(new Constraint('due_despatch_date', '<=', $db->qstr($nextmonth)));
$customersales['Next Month'] = $orderline->getSum('base_net_value', $cc, 'so_linesoverview');
$this->title = 'Title';
$this->contents['main'] = $customersales;
$this->contents['type'] = $this->params['type'];
}
开发者ID:uzerpllp,项目名称:uzerp,代码行数:47,代码来源:SalesOrdersSummaryEGlet.php
示例19: checkStartDate
public function checkStartDate($_employee_id, $_start_date, $_end_date = '')
{
$cc = new ConstraintChain();
$cc->add(new Constraint('employee_id', '=', $_employee_id));
$db = DB::Instance();
$cc1 = new ConstraintChain();
$cc1->add(new Constraint('start_date', 'between', $db->qstr(fix_date($_start_date)) . ' and ' . $db->qstr(empty($_end_date) ? fix_date(date(DATE_FORMAT)) : fix_date($_end_date))));
$cc2 = new ConstraintChain();
$cc2->add(new Constraint('start_date', '<', fix_date($_start_date)));
$cc3 = new ConstraintChain();
$cc3->add(new Constraint('end_date', '>=', fix_date($_start_date)));
$cc3->add(new Constraint('end_date', 'is', 'NULL'), 'OR');
$cc2->add($cc3);
$cc1->add($cc2, 'OR');
$cc->add($cc1);
return $this->getMax('end_date', $cc);
}
开发者ID:uzerpllp,项目名称:uzerp,代码行数:17,代码来源:EmployeeContractDetail.php
示例20: populate
function populate()
{
$invoices = new PInvoiceCollection();
$invoices->setParams();
$sh = new SearchHandler($invoices, false);
$sh->addConstraint(new Constraint('status', '=', 'O'));
$sh->addConstraint(new Constraint('due_date', '<=', fix_date(date(DATE_FORMAT))));
$this->setSearchLimit($sh);
$sh->setOrderBy('due_date');
$invoices->load($sh);
$this->contents = $invoices;
// set vars
$this->vars['type_label'] = 'Supplier';
$this->vars['type_field'] = 'supplier';
$this->vars['module'] = 'purchase_invoicing';
$this->vars['controller'] = 'pinvoices';
}
开发者ID:uzerpllp,项目名称:uzerp,代码行数:17,代码来源:POoverdueInvoicesEGlet.php
注:本文中的fix_date函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论