tested with g*Sales Version 1.4.3
direct sql connection without gsales interface ...
new customer will only be created if added new order in reseller panel
Code:
nano /var/www/ispcp/gui/reseller/orders_add.php
insert at line 284
behind ";
Code:
// gsales begin
include '../include/gsales.php';
// gsales end
save file
Code:
nano /var/www/ispcp/gui/include/gsales.php
insert
Code:
// insert start
<?php
$server = "localhost";
$username = "gsales-db-user";
$password = "gsales-db-pass";
$database = "gsales-database";
mysql_connect($server, $username, $password) or die(mysql_error());
mysql_select_db($database) or die(mysql_error());
$name = $first_name." ".$last_name;
$ptext1 = "Bitte begleichen Sie diese Rechnung bis zum {faellig}";
$ptext2 = "Bei Paypal Zahlungen bitte an: payment@domain.tld";
$ptext3 = "Alle Waren und Leistungen bleiben bis zur vollstaendigen Bezahlung Eigentum der Firma";
if ($dmn_user_name == '') {
echo "not allowed";
}
else
{
$einlesen = mysql_query("SELECT COUNT(*) FROM kunde WHERE knr='$customer_id'");
$einzeln = mysql_fetch_row($einlesen);
if($einzeln[0]==1) {
echo "";
}
else
{
$check = mysql_query("SELECT knr FROM kunde ORDER BY knr DESC LIMIT 1");
$check1 = mysql_fetch_array($check);
$knr = $check1["knr"];
$knr_new = $knr +1;
mysql_query("INSERT INTO kunde
(knr, firma, name, anschrift, plz, ort, email, status, text1, text2, text3, telefon, fax, kommentar) VALUES('$knr_new', '$firm', '$name', '$street_one', '$zip', '$city', '$user_email', '1', '$ptext1', '$ptext2', '$ptext3', '$phone', '$fax', '$dmn_user_name' ) ")
or die(mysql_error());
}
}
?>
// insert end
edit $database details and $ptext1 - $ptext3
save
and:
Code:
chmod 0440 /var/www/ispcp/gui/include/gsales.php
chown vu2000.www-data /var/www/ispcp/gui/include/gsales.php