}
    $_SESSION['SESS_FIRST_NAME'] = $fname;
    $_SESSION['SESS_LAST_NAME'] = $lname;
    $_SESSION['SESS_IMAGE_ID'] = $imageid;
    $_SESSION['SESS_CUSTOMER_ID'] = $customerid;
    sendRoleMessage("ADMIN", "User Registration", "User " . $login . " has been registered as a user.<br>Password : "******"User Registration", "<h3>Welcome {$fname} {$lname}.</h3><br>You have been invited to become a member of 'iAfrica Database'.<br>Please click on the <a href='" . getSiteConfigData()->domainurl . "/index.php'>link</a> to activate your account.<br><br><h4>Login details</h4>User ID : {$login}<br>Password : "******"location: system-register-success.php");
    } else {
        logError("1 Query failed:" . mysql_error());
    }
} else {
    $memberid = $_GET['id'];
    $qry = "UPDATE {$_SESSION['DB_PREFIX']}members " . "SET email = '{$email}', " . "firstname = '{$fname}', " . "lastname = '{$lname}', " . "customerid = {$customerid}, " . "imageid = {$imageid}, " . "lastaccessdate = NOW(), ";
    if (isset($_POST['postcode'])) {
        $qry .= "postcode = '{$postcode}', ";
    }
    $qry .= "passwd = '" . md5($password) . "', metamodifieddate = NOW(), metamodifieduserid = " . getLoggedOnMemberID() . " " . "WHERE member_id = " . $_GET['id'];
    $result = mysql_query($qry);
    if (!$result) {
        logError("UPDATE members failed:" . mysql_error());
    }
    $_SESSION['SESS_FIRST_NAME'] = $fname;
    $_SESSION['SESS_LAST_NAME'] = $lname;
    $_SESSION['SESS_IMAGE_ID'] = $imageid;
    sendRoleMessage("ADMIN", "User Amendment", "<h3>User amendment.</h3><br>Your details have been amended by the System Administration.<br>Your password has been changed to: <i>{$password}</i>.");
    sendUserMessage($memberid, "User Amendment", "<h3>User amendment.</h3><br>Your details have been amended by the System Administration.<br>Your password has been changed to: <i>{$password}</i>.");
    header("location: system-register-amend.php");
}
//Check whether the query was successful or not
Пример #2
0
}
$orderid = mysql_insert_id();
for ($row = 0; $row < count($_POST['productid']); $row++) {
    $productid = $_POST['productid'][$row];
    $qty = $_POST['qty'][$row];
    if ($qty <= 0 || $productid == "" || $productid == "0") {
        continue;
    }
    $sql = "INSERT INTO {$_SESSION['DB_PREFIX']}frequentproducts \n\t\t\t\t(\n\t\t\t\t\tsiteid, productid, frequency\n\t\t\t\t)\n\t\t\t\tVALUES\n\t\t\t\t(\n\t\t\t\t\t{$siteid}, {$productid}, {$qty}\n\t\t\t\t)";
    $result = mysql_query($sql);
    if (mysql_errno() == 1062) {
        $sql = "UPDATE {$_SESSION['DB_PREFIX']}frequentproducts SET\n\t\t\t\t\tfrequency = frequency + {$qty}\n\t\t\t\t\tWHERE siteid = {$siteid}\n\t\t\t\t\tAND productid = {$productid}";
        $result = mysql_query($sql);
        if (!$result) {
            logError($sql . " = " . mysql_error());
        }
    } else {
        if (!$result) {
            logError($sql . " = " . mysql_error());
        }
    }
    $sql = "INSERT INTO {$_SESSION['DB_PREFIX']}orderitem\n\t\t\t\t(\n\t\t\t\t\torderid, productid, quantity\n\t\t\t\t)\n\t\t\t\tVALUES\n\t\t\t\t(\n\t\t\t\t\t{$orderid}, {$productid}, {$qty}\n\t\t\t\t)";
    $result = mysql_query($sql);
    if (!$result) {
        logError($sql . " = " . mysql_error());
    }
}
mysql_query("COMMIT");
sendRoleMessage("JRM", "Confirmed order", "Confirmed order ........");
sendSiteMessage($siteid, "Confirmed customer order", "Confirmed order ........");
header("location: processorderconfirm.php?orderid={$orderid}");
Пример #3
0
    //Check whether the query was successful or not
    if ($result) {
        if (mysql_num_rows($result) == 1) {
            $member = mysql_fetch_assoc($result);
            $memberid = $member['member_id'];
            srand(time());
            for ($i = 0; $i < 10; $i++) {
                $random = rand() % 52;
                if ($random > 26) {
                    $random = $random - 26;
                    $random = $random + 32;
                }
                $word = $word . chr($random + 65);
            }
            $qry = "UPDATE {$_SESSION['DB_PREFIX']}members " . "SET passwd = '" . md5($word) . "', metamodifieddate = NOW(), metamodifieduserid = " . getLoggedOnMemberID() . " " . "WHERE member_id = {$memberid}";
            $result = mysql_query($qry);
            if (!$result) {
                logError("Error RESET PASSWORD:"******" - " . mysql_error());
            }
            $errmsg_arr[] = "An email has been sent with a reset password.";
            sendUserMessage($memberid, "Password reset", "Your password has been reset to {$word}.<br>Please contact your system administrator if you have any problems.");
            sendRoleMessage("ADMIN", "Password reset", "User {$login} has had the password reset to {$word}.");
        } else {
            $errmsg_arr[] = "Invalid user.";
        }
    } else {
        $errmsg_arr[] = "Invalid user.";
    }
}
$_SESSION['ERRMSG_ARR'] = $errmsg_arr;
header("location: passwordchanged.php");
Пример #4
0
    $matchid = mysql_insert_id();
    if (!$result) {
        logError($qry . " - " . mysql_error());
    }
    for ($i = 0; $i < count($_POST['player']); $i++) {
        $playerid = $_POST['player'][$i];
        $qry = "INSERT INTO {$_SESSION['DB_PREFIX']}matchplayerdetails \n\t\t\t\t\t(\n\t\t\t\t\t\tmatchid, playerid, metacreateduserid, metamodifieduserid, \n\t\t\t\t\t\tmetacreateddate, metamodifieddate\n\t\t\t\t\t)\n\t\t\t\t\tVALUES\n\t\t\t\t\t(\n\t\t\t\t\t\t{$matchid}, {$playerid}, {$memberid}, {$memberid}, \n\t\t\t\t\t\tNOW(), NOW()\n\t\t\t\t\t)";
        $result = mysql_query($qry);
        if (!$result) {
            logError($qry . " - " . mysql_error());
        }
    }
    $details = "Match report attached for match on " . $_POST['matchdate'];
    $file = "uploads/matchcard{$id}" . session_id() . ".pdf";
    $report = new MatchCardReport('P', 'mm', 'A4', $matchid);
    $report->Output($file, "F");
    sendTeamMessage($teamid, "Match Report Confirmed", $details, "", array($file));
    sendRoleMessage("LEAGUE", "Match Report Confirmed", $details, "", array($file));
    if ($_POST['refereescore'] < 50 && $_POST['refereescore'] > 0) {
        $refname = GetRefereeName($refereeid);
        $refdetails = "Referee {$refname} has scored {$refereescore}<br><br>Report:<br>" . $_POST['refereeremarks'];
        smtpmailer(getSiteConfigData()->refereereportemail, "*****@*****.**", $_SESSION['SESS_TEAM_EMAIL'], "Referee Report", $refdetails);
    }
} catch (Exception $e) {
    logError("Signing image: " . $e->getMessage());
}
mysql_query("COMMIT");
header("location: matchconfirm.php?id={$matchid}");
?>
		
<?php

require_once "system-db.php";
require_once 'reportdailycostslibdata.php';
start_db();
$file = "uploads/emailforecast-" . session_id() . "-" . time() . ".pdf";
$report = new SalesReport('P', 'mm', 'A4', date("d/m/Y"));
$report->Output($file, "F");
sendRoleMessage("FORECASTALERT", "Forecast Results", "Forecast information attached", array($file));
Пример #6
0
<?php

require_once "system-db.php";
start_db();
sendRoleMessage("ALERT", "Daily alert task schedule", "Information: Alerts task schedule run at " . date("d/m/Y"));
/********************************************************************* END OF SCHEDULE **************************************/
$qry = "UPDATE {$_SESSION['DB_PREFIX']}siteconfig SET lastschedulerun = CURDATE(), metamodifieddate = NOW(), metamodifieduserid = " . getLoggedOnMemberID() . "";
$result = mysql_query($qry);
if (!$result) {
    logError("Error: " . mysql_error(), false);
}