Ejemplo n.º 1
0
 public function display()
 {
     if (Tools::isSubmit('action') && Tools::getValue('action') == 'viewLog') {
         //loads the log content
         $log_content = CertissimLogger::getLogContent();
         $log_txt = CertissimTools::convert_encoding($log_content, 'UTF-8');
         $url_back = 'index.php?tab=AdminModules&configure=fianetfraud&tab_module=payment_security&module_name=fianetfraud&token=' . Tools::getAdminTokenLite('AdminModules');
         echo "<center><a style='padding: 3px; margin: 6px; border: 1px solid black' href='" . $url_back . "'>" . $this->l('Back to configuration page') . "</a></center><textarea style='margin: 6px' cols='160' rows='50' readOnly>{$log_txt}</textarea><div class='clear'></div><center><a style='padding: 3px; margin: 6px; border: 1px solid black' href='" . $url_back . "'>" . $this->l('Back to configuration page') . "</a></center>";
     } else {
         echo parent::display();
     }
 }
Ejemplo n.º 2
0
 /**
  * updates a certissim order with the fields given as a paramater and returns true if success, false otherwiser
  * 
  * @param int $id_order id of the order to update
  * @param array $fields
  * @return boolean
  */
 public static function updateCertissimOrder($id_order, array $fields)
 {
     //if no fields to update, end of process
     if (empty($fields)) {
         CertissimLogger::insertLog(__METHOD__ . " : " . __LINE__, "Tableau de champs vide.");
         return false;
     }
     //initialization of the part of the SQL string that defines the updates
     $set_string = "";
     foreach ($fields as $fieldname => $fieldvalue) {
         $set_string .= "`{$fieldname}`='" . pSQL(CertissimTools::convert_encoding($fieldvalue, ini_get('default_charset'))) . "', ";
     }
     $set_string = substr($set_string, 0, -2);
     //removes the ', ' at the end of the string
     $sql = "UPDATE `" . _DB_PREFIX_ . self::CERTISSIM_ORDER_TABLE_NAME . "` SET {$set_string} WHERE `id_order`='{$id_order}'";
     //builds the total SQL string
     $updated = Db::getInstance()->execute($sql);
     //executes the SQL query
     if (!$updated) {
         CertissimLogger::insertLog(__METHOD__ . " : " . __LINE__, "Mise à jour échouée pour la requête : {$sql}");
     } else {
         CertissimLogger::insertLog(__METHOD__ . " : " . __LINE__, "Mise à jour OK pour la requête : {$sql}");
     }
     return $updated;
 }