About my changes on php class... is there any bug in my changes ? I need help, thanks.
- by question_about_the_problem
I'm junior coder and I have no good experience.
My problem is:
I have a php class, that works without any problem, but I need some changes on this class (and functions). And i don't have fax machine right now to try. is there any bug in my changes ?
Here is my changes text:
1.) Open the file xxx.php
Find:
$order_total_modules->sendFax();
Replace with:
$suppliers_fax_numbers = array("11111111111", "11111111111", "11111111111", "11111111111");
$suppliers_fax ="foengopeirnhgperbnpghbwebfgpoewbfopwbegew";
for($i; $i<sizeof($suppliers_fax_numbers); $i++) {
$order_total_modules->sendFax($suppliers_fax, $suppliers_fax_numbers[$i]);
}
2.) Open the file xxx.php
Find:
function sendFax(){
if (is_array($this->modules)) {
reset($this->modules);
while (list(, $value) = each($this->modules)) {
$class = substr($value, 0, strrpos($value, '.'));
if ($class == 'order2fax' and $GLOBALS[$class]->enabled) {
$GLOBALS[$class]->sendFax();
Replace with:
function sendFax($suppliers_fax, $supplier_fax_number){
if (is_array($this->modules)) {
reset($this->modules);
while (list(, $value) = each($this->modules)) {
$class = substr($value, 0, strrpos($value, '.'));
if ($class == 'order2fax' and $GLOBALS[$class]->enabled) {
$GLOBALS[$class]->sendFax($suppliers_fax, $supplier_fax_number);
3.) Open the file xxx.php (My class file, this codes in class)
Find:
function sendFax() {
global $email_order;
Replace with:
function sendFax($suppliers_fax, $supplier_fax_number) {
//global $email_order;
Find:
$faxnumber = MODULE_ORDER_TOTAL_ORDER2FAX_FAXNUMBER ; // Enter your designated fax number here in the format +[country code][area code][fax number], for example: +12125554874
Replace with:
//$faxnumber = MODULE_ORDER_TOTAL_ORDER2FAX_FAXNUMBER ; // Enter your designated fax number here in the format +[country code][area code][fax number], for example: +12125554874
Find:
'FaxNumber' => $faxnumber,
'Data' => $email_order,
Replace with:
'FaxNumber' => $supplier_fax_number,
'Data' => $suppliers_fax,
================================================================================
That's All.