grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026getActiveSheet(); foreach($sheet->getRowIterator() as $row){ $cellIterator = $row->getCellIterator(); $cellIterator->setIterateOnlyExistingCells(FALSE); $cells = []; foreach ($cellIterator as $cell) { $cells[] = $cell->getValue(); } if (substr($cells[0],0,1) != "0") { $cells[0] = "0".$cells[0]; } $t = $patern; $t = str_replace("token20" , $cells[3] , $t); $t = str_replace("token10", $cells[2] , $t); $t = str_replace("token", $cells[1] , $t); try{ $api = new \Kavenegar\KavenegarApi("79476155534B63532F7661566C35434969616A4174315167544F4B46463430486F4D61735448586E32694D3D", true); $result = $api->VerifyLookup2($cells[0], $cells[1], $cells[2], $cells[3], "newmali2"); } catch(\Kavenegar\Exceptions\ApiException $e){ // در صورتی که خروجی وب سرویس 200 نباشد این خطا رخ می دهد echo $e->errorMessage(); var_dump([$cells[0], $cells[1], $cells[2], $cells[3], "newmali2"]); die(); } catch(\Kavenegar\Exceptions\HttpException $e){ // در زمانی که مشکلی در برقرای ارتباط با وب سرویس وجود داشته باشد این خطا رخ می دهد echo $e->errorMessage(); die(); } $data = [ $cells[0], $t, $userId ]; if(!empty($data)){ $sql = "INSERT INTO sms_log (phone, message, user_id) VALUES (?, ?, ?)"; $stmt = $pdo->prepare($sql); $stmt->execute($data); } } $_SESSION['success'] = true; header('Location: index.php'); } } ?>