31 ini_set(
"session.gc_maxlifetime", 36000);
36 $sSelect =
"select oxpricealarm.oxid, oxpricealarm.oxemail, oxpricealarm.oxartid, oxpricealarm.oxprice " .
37 "from oxpricealarm, oxarticles where oxarticles.oxid = oxpricealarm.oxartid " .
38 "and oxpricealarm.oxsended = '0000-00-00 00:00:00'";
40 $rs = $oDB->SelectLimit($sSelect,
$myConfig->getConfigParam(
'iCntofMails'), $iStart);
42 $rs = $oDB->Execute($sSelect);
47 if ($rs !=
false && $rs->recordCount() > 0) {
49 $oArticle =
oxNew(
"oxarticle");
50 $oArticle->load($rs->fields[
'oxid']);
51 if ($oArticle->getPrice()->getBruttoPrice() <= $rs->fields[
'oxprice']) {
53 $rs->fields[
'oxemail'],
54 $rs->fields[
'oxartid'],
56 $rs->fields[
'oxprice']
63 if (!isset($iStart)) {
66 $iAllCnt = $iAllCntTmp;
71 $iStart +=
$myConfig->getConfigParam(
'iCntofMails');
73 $this->_aViewData[
"iStart"] = $iStart;
74 $this->_aViewData[
"iAllCnt"] = $iAllCnt;
78 if ($iStart < $iAllCnt) {
79 $sPage =
"pricealarm_send.tpl";
81 $sPage =
"pricealarm_done.tpl";
105 public function sendeMail($sEMail, $sProductID, $sPricealarmID, $sBidPrice)
108 $oAlarm =
oxNew(
"oxpricealarm");
109 $oAlarm->load($sPricealarmID);
112 $iLang = (int) $oAlarm->oxpricealarm__oxlang->value;
114 $iOldLangId = $oLang->getTplLanguage();
115 $oLang->setTplLanguage($iLang);
117 $oEmail =
oxNew(
'oxemail');
118 $blSuccess = (int) $oEmail->sendPricealarmToCustomer($sEMail, $oAlarm);
120 $oLang->setTplLanguage($iOldLangId);
123 $oAlarm->oxpricealarm__oxsended =
new oxField(date(
"Y-m-d H:i:s"));