Exemplo n.º 1
0
$isData = false;
$costOfCall = 0.0;
$callDestination = '';
$VASName = '';
$VASProvider = '';
$billMonth = 0;
$billYear = 0;
$simContractID = 0;
$serviceDescription = '';
$file_handle = fopen("itm-C0009442-8.csv", "r");
$line_of_text = new ArrayObject();
$cellphoneNumber = '';
$resultMessage = '';
$categoryId = 0;
$db = new BaseDB();
$db->dbTransactionBegin();
$startTime = date_create();
//		$i         = 10000;
if ($file_handle != false) {
    //				while (!feof($file_handle) && $i > 0 && strlen($resultMessage) === 0) {
    while (!feof($file_handle) && strlen($resultMessage) === 0) {
        //		while (!feof($file_handle)) {
        global $line_of_text;
        set_time_limit(10);
        $line_of_text = fgetcsv($file_handle, 1024, ',');
        switch (true) {
            case startsWith($line_of_text[0], 'New Client - Cell Number : '):
                SetSimContractID(trim($line_of_text[0]));
                break;
            case startsWith($line_of_text[0], 'Voicemail - Deposits'):
            case startsWith($line_of_text[0], 'Vodacom to'):