本文整理匯總了PHP中GlobalConfig::checkOpenSiVersion方法的典型用法代碼示例。如果您正苦於以下問題:PHP GlobalConfig::checkOpenSiVersion方法的具體用法?PHP GlobalConfig::checkOpenSiVersion怎麽用?PHP GlobalConfig::checkOpenSiVersion使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GlobalConfig
的用法示例。
在下文中一共展示了GlobalConfig::checkOpenSiVersion方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: hookAdminOrder
public function hookAdminOrder($params)
{
if (Configuration::get('OSI_HOOK_ADMIN_ORDER') == 1) {
global $cookie;
$order = new Order($params['id_order']);
$return = Db::getInstance()->ExecuteS('SELECT * FROM ' . _DB_PREFIX_ . 'opensi_order WHERE id_order = \'' . (int) $order->id . '\' LIMIT 1');
$html = '
<br /><br />
<fieldset style="width:400px">
<legend><img src="' . $this->_path . 'logo.gif" alt="" /> ' . $this->l('Sync with OpenSi') . '</legend>
';
/*
* Check if upgrade is available
*/
if (@ini_get('allow_url_fopen') and $update = GlobalConfig::checkOpenSiVersion($this->version)) {
$html .= '<div class="warn">' . $this->l('New OpenSi version available') . '<br /><a style="text-decoration: underline;" href="' . $update['link'] . '">' . $this->l('Download') . ' ' . $update['name'] . '</a> !</div>';
}
/*
* Is the order synchronized with OpenSi ?
*/
if (isset($return[0]['id_order'])) {
$html .= $this->l('Order synchronized with OpenSi the :') . ' ' . Tools::displayDate($return[0]['date_order_synchro'], (int) $cookie->id_lang, true);
} else {
$html .= $this->l('Order not synchronized with OpenSi.');
}
/* Display links of OpenSi invoices if available */
$query = 'SELECT * FROM ' . _DB_PREFIX_ . 'opensi_invoice WHERE id_order = \'' . (int) $order->id . '\'';
if ($links = Db::getInstance()->ExecuteS($query)) {
$html .= '<br />';
$i = 0;
foreach ($links as $link) {
$html .= '<br /><img src="' . $this->_path . 'img/invoice.png" alt="" /> <a href="' . _PS_BASE_URL_ . __PS_BASE_URI__ . $this->_moduleUri . 'getInvoice.php?key=' . $link['url_key'] . '">';
if ($link['type'] == 'F') {
$html .= $this->l('Invoice') . ' ' . $link['number_invoice'] . '.pdf';
} else {
if ($link['type'] == 'A') {
$html .= $this->l('Credit') . ' ' . $link['number_invoice'] . '.pdf';
}
}
$html .= '</a>';
$i++;
}
}
$html .= '</fieldset>';
return $html;
}
}