dump($ndata); include_once '../../Classes/Telenor.php'; $telenor = new Telenor('923458219245', '7264'); //$telenor->setMask('NEXEXCEL'); $sms_template_1 = "Dear %s %s, You have %d Cheque as of %s for a total of %s %s from\n"; $sms_template_2 = "%s - %s %s\n"; foreach ($ndata as $user_id => $data) { $currencyCode = getCurrencySymbol($data['company_ref_id']); $total = (double) 0; $sms = ""; foreach ($data['data'] as $row) { $total += $row['debit_amount']; $sms .= sprintf($sms_template_2, $row['account_name'], $currencyCode, number_format($row['debit_amount'])); } $sms = trim(sprintf($sms_template_1, $data['first_name'], $data['last_name'], count($data['data']), date("d-M-y"), $currencyCode, number_format($total)) . $sms); $ret = $telenor->sendSms($data['mobile_number'], $sms); if ($ret === false) { $error = $telenor->getError(); dump($error); } } } $out = ob_get_contents(); ob_end_clean(); if (!isLive()) { $fp = fopen('sms_cron.htm', 'w'); fwrite($fp, "<html><head><title>SMS CRON</title></head><body>"); fwrite($fp, $out); fwrite($fp, "</body></html>"); fclose($fp); }
<?php ob_start(); echo "</pre>"; chdir(dirname(__FILE__)); include_once '../../Classes/Telenor.php'; $telenor = new Telenor('923458219245', '7264'); //$telenor->setMask('NEXEXCEL'); $sms_template_1 = "Dear %s %s, You have %d Cheque as of %s for a total of Rs. %s\n"; $sms = sprintf($sms_template_1, 'Imran', 'Zahid', 5, date("d-M-y"), '12,345'); $ret = $telenor->sendSms('+923458250386', $sms); if ($ret === false) { $error = $telenor->getError(); print_r($error); } echo "</pre>"; $out = ob_get_contents(); ob_end_clean(); $fp = fopen('sms_cron.htm', 'w'); fwrite($fp, "<html><head><title>SMS CRON</title></head><body>"); fwrite($fp, $out); fwrite($fp, "</body></html>"); fclose($fp);